location: Create Geoclue proxy asynchronously

https://bugzilla.gnome.org/show_bug.cgi?id=723684
This commit is contained in:
Zeeshan Ali (Khattak) 2014-02-15 13:42:43 +00:00
parent 8f1b8909dc
commit 7826fb4f04

View File

@ -41,10 +41,19 @@ const Indicator = new Lang.Class({
}, },
_onGeoclueAppeared: function() { _onGeoclueAppeared: function() {
// FIXME: This should be done async new GeoclueManager(Gio.DBus.system,
this._proxy = new GeoclueManager(Gio.DBus.system, 'org.freedesktop.GeoClue2',
'org.freedesktop.GeoClue2', '/org/freedesktop/GeoClue2/Manager',
'/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._proxy.connect('g-properties-changed', Lang.bind(this, this._sync));
this._sync(); this._sync();