hal/hald hald_dbus.c,1.9,1.10
David Zeuthen
david at freedesktop.org
Wed Sep 15 02:16:58 PDT 2004
Update of /cvs/hal/hal/hald
In directory gabe:/tmp/cvs-serv28957/hald
Modified Files:
hald_dbus.c
Log Message:
2004-09-15 David Zeuthen <david at fubar.dk>
* hald/hald_dbus.c (foreach_device_match_get_udi_tdl): New function
(manager_find_device_string_match): Also return devices in the TDL
that has a non-temporary UDI
Index: hald_dbus.c
===================================================================
RCS file: /cvs/hal/hal/hald/hald_dbus.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- hald_dbus.c 1 Sep 2004 17:38:58 -0000 1.9
+++ hald_dbus.c 15 Sep 2004 09:16:56 -0000 1.10
@@ -274,8 +274,34 @@
return TRUE;
}
+static gboolean
+foreach_device_match_get_udi_tdl (HalDeviceStore *store, HalDevice *device,
+ gpointer user_data)
+{
+ DeviceMatchInfo *info = user_data;
+ const char *dev_value;
+
+ /* skip devices in the TDL that hasn't got a real UDI yet */
+ if (strncmp (device->udi, "/org/freedesktop/Hal/devices/temp",
+ sizeof ("/org/freedesktop/Hal/devices/temp")) == 0)
+ return TRUE;
+
+ if (hal_device_property_get_type (device,
+ info->key) != DBUS_TYPE_STRING)
+ return TRUE;
+
+ dev_value = hal_device_property_get_string (device, info->key);
+
+ if (dev_value != NULL && strcmp (dev_value, info->value) == 0) {
+ dbus_message_iter_append_string (info->iter,
+ hal_device_get_udi (device));
+ }
+
+ return TRUE;
+}
+
/** Find devices in the GDL where a single string property matches a given
- * value.
+ * value. Also returns devices in the TDL that has a non-tmp UDI.
*
* <pre>
* array{object_reference} Manager.FindDeviceStringMatch(string key,
@@ -326,6 +352,11 @@
foreach_device_match_get_udi,
&info);
+ /* Also returns devices in the TDL that has a non-tmp UDI */
+ hal_device_store_foreach (hald_get_tdl (),
+ foreach_device_match_get_udi_tdl,
+ &info);
+
if (!dbus_connection_send (connection, reply, NULL))
DIE (("No memory"));
More information about the hal-commit
mailing list