[gnome-shell] location: Make _connectToGeoclue() reentrent



commit 12ef034b7ba29404bc3fd4e384115e7b00f3c125
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sat Feb 15 15:17:58 2014 +0000

    location: Make _connectToGeoclue() reentrent
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723684

 js/ui/status/location.js |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/status/location.js b/js/ui/status/location.js
index bc42a4e..b14bd8a 100644
--- a/js/ui/status/location.js
+++ b/js/ui/status/location.js
@@ -41,13 +41,19 @@ const Indicator = new Lang.Class({
     },
 
     _connectToGeoclue: function() {
+        if (this._proxy != null || this._connecting)
+            return false;
+
+        this._connecting = true;
         new GeoclueManager(Gio.DBus.system,
                            'org.freedesktop.GeoClue2',
                            '/org/freedesktop/GeoClue2/Manager',
                            Lang.bind(this, this._onProxyReady));
+        return true;
     },
 
     _onProxyReady: function (proxy, error) {
+        this._connecting = false;
         if (error != null) {
             log (error.message);
             return;


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