GNOME Bugzilla – Bug 680137
Collect results from both search providers
Last modified: 2012-08-03 21:14:13 UTC
Currently we only use the compiled in search provider. This is unfortunate because this means if tracker is enabled we get no results for any locations it isn't configured to index.
Created attachment 219076 [details] [review] Collect results from both search providers Previously we would only use the compiled in search provider. Now it has been changed to run both providers at the same time and merge the results by URI.
Review of attachment 219076 [details] [review]: Looks mostly good, but I think you forgot to git add nautilus-search-provider.[ch] ::: libnautilus-private/nautilus-search-engine.c @@ +91,3 @@ + if (count == 0) + added = g_list_prepend (added, uri); + char *uri = l->data; You should g_strdup() the uri @@ +116,3 @@ + g_hash_table_remove (engine->details->uris, uri); + } else { + count = GPOINTER_TO_INT (g_hash_table_lookup (engine->details->uris, uri)); Same here @@ +132,2 @@ +{ + nautilus_search_provider_error (NAUTILUS_SEARCH_PROVIDER (engine), error_message); I think we should either also stop the other provider when an error happens, or avoid propagating the error unless both engines signal an error (if we do this, we should also run search_provider_finished() after the first error)...we don't want to end up in a situation where an error is reported to the view, triggering a dialog, but the directory keeps refreshing below because the other engine is still running.
Created attachment 219091 [details] [review] Collect results from both search providers Previously we would only use the compiled in search provider. Now it has been changed to run both providers at the same time and merge the results by URI.
Review of attachment 219091 [details] [review]: ::: libnautilus-private/nautilus-search-engine.c @@ +137,3 @@ +{ + DEBUG ("Search provider error: %s", error_message); + engine->details->providers_error++; I think the logic here is still slightly wrong: - There should be no need to call _finished() after _error() - Let's say the first engine finishes, and later the second one errors out (or viceversa). With this code, no "error" or "finished" signals would be emitted, since both providers_error and providers_finished would be 1. ::: libnautilus-private/nautilus-search-provider.c @@ +64,3 @@ + } + + g_signal_new ("hits-added", Should be consistent with other similar code here and use signals[SIGNAL_NAME] = g_signal_new()... @@ +133,3 @@ + g_return_if_fail (NAUTILUS_IS_SEARCH_PROVIDER (provider)); + + g_signal_emit_by_name (provider, "hits-added", hits); ...and then use g_signal_emit(provider, signals[SIGNAL_NAME]) here.
Created attachment 219127 [details] [review] Collect results from both search providers Previously we would only use the compiled in search provider. Now it has been changed to run both providers at the same time and merge the results by URI.
Created attachment 219129 [details] [review] Collect results from both search providers Previously we would only use the compiled in search provider. Now it has been changed to run both providers at the same time and merge the results by URI.
Review of attachment 219129 [details] [review]: Looks good now, thanks!
Attachment 219129 [details] pushed as 79869fd - Collect results from both search providers
*** Bug 671606 has been marked as a duplicate of this bug. ***
*** Bug 677929 has been marked as a duplicate of this bug. ***