[gnome-shell] Search: use the same settings object for loading search providers
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Search: use the same settings object for loading search providers
- Date: Fri, 27 Mar 2015 20:13:31 +0000 (UTC)
commit 048a14f1f3542b4f897d3353b13da13922c2d47f
Author: Giovanni Campagna <gcampagna gnome org>
Date: Thu Mar 19 23:58:19 2015 -0700
Search: use the same settings object for loading search providers
In recent glib, change notifications don't actually happen unless all
keys have been read, in an effort to reduce unnecessary dbus
traffic for shortlived GSettings object and avoid AddMatch calls.
But we care about changes here, so we need to make sure we're
subscribed, and an easy way to do so is to reuse the same object
to watch for changes and to load the active providers at startup.
https://bugzilla.gnome.org/show_bug.cgi?id=746509
js/ui/remoteSearch.js | 3 +--
js/ui/search.js | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js
index 4fc5000..efe6bc2 100644
--- a/js/ui/remoteSearch.js
+++ b/js/ui/remoteSearch.js
@@ -63,7 +63,7 @@ const SearchProvider2Iface = '<node> \
var SearchProviderProxyInfo = Gio.DBusInterfaceInfo.new_for_xml(SearchProviderIface);
var SearchProvider2ProxyInfo = Gio.DBusInterfaceInfo.new_for_xml(SearchProvider2Iface);
-function loadRemoteSearchProviders(callback) {
+function loadRemoteSearchProviders(searchSettings, callback) {
let objectPaths = {};
let loadedProviders = [];
@@ -124,7 +124,6 @@ function loadRemoteSearchProviders(callback) {
}
}
- let searchSettings = new Gio.Settings({ schema_id: Search.SEARCH_PROVIDERS_SCHEMA });
if (searchSettings.get_boolean('disable-external')) {
callback([]);
return;
diff --git a/js/ui/search.js b/js/ui/search.js
index d4468f3..2ea1afb 100644
--- a/js/ui/search.js
+++ b/js/ui/search.js
@@ -435,7 +435,7 @@ const SearchResults = new Lang.Class({
this._unregisterProvider(provider);
}));
- RemoteSearch.loadRemoteSearchProviders(Lang.bind(this, function(providers) {
+ RemoteSearch.loadRemoteSearchProviders(this._searchSettings, Lang.bind(this, function(providers) {
providers.forEach(Lang.bind(this, this._registerProvider));
}));
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]