[gnome-shell/wip/re-search-v2: 11/33] remote-search: launch the app if LaunchSearch is not available



commit 4522291cc68f507783bfccfbfd340b203837e8de
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Nov 26 23:50:49 2012 -0500

    remote-search: launch the app if LaunchSearch is not available
    
    But log a message, so we can file bugs for apps.

 js/ui/remoteSearch.js |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js
index 503e632..317b18a 100644
--- a/js/ui/remoteSearch.js
+++ b/js/ui/remoteSearch.js
@@ -264,8 +264,14 @@ const RemoteSearchProvider = new Lang.Class({
     },
 
     launchSearch: function(terms) {
-        this._proxy.LaunchSearchRemote(terms);
+        this._proxy.LaunchSearchRemote(terms, Lang.bind(this,
+            function(result, error) {
+                if (error && error.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD)) {
+                    // the provider is not compatible with this version of the interface, launch
+                    // the app itself but warn so we can catch the error in logs
+                    log('Search provider ' + this.appInfo.get_id() + ' does not implement LaunchSearch');
+                    this.appInfo.launch([], global.create_app_launch_context());
+                }
+            }));
     }
 });
-
-



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