GNOME Bugzilla – Bug 643023
Allow users to install new search providers
Last modified: 2012-08-28 19:14:53 UTC
The code in js/ui/search.js only loads the OpenSearch providers from the gnome-shell datadir, not from the user's datadir: let file = Gio.file_new_for_path(global.datadir + '/search_providers'); This means I cannot install my own OpenSearch providers as a normal user. (I wanted to add an IMDb search)
Created attachment 188482 [details] [review] Enable local search providers I've attached a small patch that scans ${global.userdatadir}/search_providers for search providers in addition to the global location. This patch is against 3.0.1 shipped in Fedora, but it applies to git master as well with small offsets. I would like to see the search providers show up in a different order (in particular, it seems useful to have user-local ones first, or alphabetize all of them), but that seems like a task for a separate patch, particularly since it will involve dealing correctly with ordering the final results from two async requests.
Review of attachment 188482 [details] [review]: You should add your patches with the result of git format-patch. ::: gnome-shell-3.0.1.orig/js/ui/search.js @@ +308,3 @@ + this._providers = []; + let names = global.settings.get_strv(DISABLED_OPEN_SEARCH_PROVIDERS_KEY); + this._scanProviders(names, global.datadir); You need to iterate through all system data dirs. Use GLib.get_system_data_dirs(). See ExtensionSystem.loadExtensions for a similar case.
Created attachment 194538 [details] [review] Update search providers for local & all system dirs I've updated the patch to search all system data dirs in addition to the user data dir. It is also now in git format-patch format. Unfortunately, I have not yet had an opportunity to test it, as installing a Fedora 16 VM has been unexpectedly difficult.
Support for open-search providers has been removed from the shell - according to the design, those should be provided by the (yet non-existent) Web search provider.