[gnome-shell] remote-search: initialize the DBus proxy asynchronously
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] remote-search: initialize the DBus proxy asynchronously
- Date: Tue, 6 Nov 2012 23:17:54 +0000 (UTC)
commit 10c104529f4cd2feb07779182e2a49de70f8f269
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Nov 1 17:28:46 2012 -0400
remote-search: initialize the DBus proxy asynchronously
Initializing this synchronously means that we will possibly wait for the
process to be auto-activated and answering to our call.
If the process is already running it also might not answer immediately
our request, as it might be doing sync I/O.
The right thing to do is to initialize the proxy asynchronously; there
are try/catch blocks in place for when the object is not available, or
not properly initialized.
https://bugzilla.gnome.org/show_bug.cgi?id=687491
js/ui/remoteSearch.js | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js
index c4462e9..58283d5 100644
--- a/js/ui/remoteSearch.js
+++ b/js/ui/remoteSearch.js
@@ -113,12 +113,16 @@ const RemoteSearchProvider = new Lang.Class({
_init: function(title, icon, dbusName, dbusPath) {
this._proxy = new SearchProviderProxy(Gio.DBus.session,
- dbusName, dbusPath);
+ dbusName, dbusPath, Lang.bind(this, this._onProxyConstructed));
this.parent(title.toUpperCase());
this._cancellable = new Gio.Cancellable();
},
+ _onProxyConstructed: function(proxy) {
+ // Do nothing
+ },
+
createIcon: function(size, meta) {
if (meta['gicon']) {
return new St.Icon({ gicon: Gio.icon_new_for_string(meta['gicon']),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]