hal: Branch 'master'
Richard Hughes
hughsient at kemper.freedesktop.org
Mon Aug 21 15:09:58 PDT 2006
hald/hald_dbus.c | 45 ++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 44 insertions(+), 1 deletion(-)
New commits:
diff-tree 1fe97744e639895b4342a1e7c9a22ac8a9920f43 (from 0e0c9da6f5957eceff3b372c554697d7abbf4804)
Author: Kevin Ottens <ervin at kde.org>
Date: Mon Aug 21 23:09:28 2006 +0100
correct the introspection to list all objects
Find attached a patch for hald_dbus.c that allows to list all the objects
available in the HAL daemon (the manager object and all the devices). That
completes the HAL introspection.
diff --git a/hald/hald_dbus.c b/hald/hald_dbus.c
index 2526554..3e270af 100644
--- a/hald/hald_dbus.c
+++ b/hald/hald_dbus.c
@@ -3123,6 +3123,22 @@ error:
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
+static gboolean
+foreach_device_get_xml_node (HalDeviceStore *store, HalDevice *device,
+ gpointer user_data)
+{
+ GString *xml = user_data;
+ const char *udi, *name;
+
+ udi = hal_device_get_udi (device);
+ name = strrchr(udi, '/')+1;
+
+ xml = g_string_append(xml, " <node name=\"");
+ xml = g_string_append(xml, name);
+ xml = g_string_append(xml, "\"/>\n");
+
+ return TRUE;
+}
static DBusHandlerResult
do_introspect (DBusConnection *connection,
@@ -3147,7 +3163,34 @@ do_introspect (DBusConnection *connecti
" </method>\n"
" </interface>\n");
- if (strcmp (path, "/org/freedesktop/Hal/Manager") == 0) {
+ if (strcmp (path, "/") == 0) {
+
+ xml = g_string_append (xml,
+ " <node name=\"org\"/>\n");
+
+ } else if (strcmp (path, "/org") == 0) {
+
+ xml = g_string_append (xml,
+ " <node name=\"freedesktop\"/>\n");
+
+ } else if (strcmp (path, "/org/freedesktop") == 0) {
+
+ xml = g_string_append (xml,
+ " <node name=\"Hal\"/>\n");
+
+ } else if (strcmp (path, "/org/freedesktop/Hal") == 0) {
+
+ xml = g_string_append (xml,
+ " <node name=\"Manager\"/>\n"
+ " <node name=\"devices\"/>\n");
+
+ } else if (strcmp (path, "/org/freedesktop/Hal/devices") == 0) {
+
+ hal_device_store_foreach (hald_get_gdl (),
+ foreach_device_get_xml_node,
+ xml);
+
+ } else if (strcmp (path, "/org/freedesktop/Hal/Manager") == 0) {
xml = g_string_append (xml,
" <interface name=\"org.freedesktop.Hal.Manager\">\n"
More information about the hal-commit
mailing list