[gnome-shell] location: Create Geoclue proxy asynchronously



commit 7826fb4f041ecf33e131c5f76b9adb942fc4684e
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sat Feb 15 13:42:43 2014 +0000

    location: Create Geoclue proxy asynchronously
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723684

 js/ui/status/location.js |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/status/location.js b/js/ui/status/location.js
index 4a46014..793e5a0 100644
--- a/js/ui/status/location.js
+++ b/js/ui/status/location.js
@@ -41,10 +41,19 @@ const Indicator = new Lang.Class({
     },
 
     _onGeoclueAppeared: function() {
-        // FIXME: This should be done async
-        this._proxy = new GeoclueManager(Gio.DBus.system,
-                                         'org.freedesktop.GeoClue2',
-                                         '/org/freedesktop/GeoClue2/Manager');
+        new GeoclueManager(Gio.DBus.system,
+                           'org.freedesktop.GeoClue2',
+                           '/org/freedesktop/GeoClue2/Manager',
+                           Lang.bind(this, this._onProxyReady));
+    },
+
+    _onProxyReady: function (proxy, error) {
+        if (error != null) {
+            log (error.message);
+            return;
+        }
+
+        this._proxy = proxy;
         this._proxy.connect('g-properties-changed', Lang.bind(this, this._sync));
 
         this._sync();


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