[rygel] Call Dbus.ListNames asynchronously



commit fecb347a1f99d9747029b654c9f1aae1a43f73b7
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue May 12 18:45:04 2009 +0300

    Call Dbus.ListNames asynchronously
---
 src/plugins/external/rygel-external-plugin.vala |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/plugins/external/rygel-external-plugin.vala b/src/plugins/external/rygel-external-plugin.vala
index 88b7132..affeba2 100644
--- a/src/plugins/external/rygel-external-plugin.vala
+++ b/src/plugins/external/rygel-external-plugin.vala
@@ -59,7 +59,18 @@ public class ExternalPluginFactory {
                                                DBUS_IFACE);
         this.loader = loader;
 
-        string[] services = dbus_obj.ListNames ();
+        dbus_obj.ListNames (this.list_names_cb);
+    }
+
+    private void list_names_cb (string[]   services,
+                                GLib.Error err) {
+        if (err != null) {
+            critical ("Failed to fetch list of external services: %s\n",
+                      err.message);
+
+            return;
+        }
+
         foreach (var service in services) {
             if (service.has_prefix (SERVICE_PREFIX)) {
                 loader.add_plugin (new ExternalPlugin (connection,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]