summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2015-07-22 00:05:53 +0200
committerCarlos Soriano <csoriano@gnome.org>2015-07-22 13:02:04 +0200
commitff6ccbaf40afe9cde56746990888246ac3fdd177 (patch)
treee021f62d3a92a74c3a84007326e3c7b95aa7af6a /test
parent902cac93a1748e7d2029c626c16d88d91b8c336e (diff)
downloadnautilus-ff6ccbaf40afe9cde56746990888246ac3fdd177.tar.gz
search: done loading signal only if not restarting engine
It was working as: - Search directory starts a new search - Search engine starts all search providers, each one in its own thread. - User changes query - Search engine stops all search providers - Searchs providers, since they are in its own thread, cancel in a unknown time. - Search directory starts a new search, even before all providers are finished. - Search engine is marked as need to restart. - Search providers finished. - Search engine emits finished signal, since all search providers now are stopped. - Clients doesn't have a way to know if the engine actually finished searching the current search, or the previous search that the client asked to stop. That might confuse clients if they ask for results. - Search engine restart the search providers without noticing the client, that thinks that the latest search it started was finished already. So to fix this confusion, only report that the engine actually finished if the engine is not going to restart the search providers. In this way a client can start a batch of consecutive searches without the risk of getting search finished signals from previous searches. Clients now will always get the search-finished signal of the latest search they started.
Diffstat (limited to 'test')
-rw-r--r--test/test-nautilus-search-engine.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/test-nautilus-search-engine.c b/test/test-nautilus-search-engine.c
index d7270350d..5353a4bf0 100644
--- a/test/test-nautilus-search-engine.c
+++ b/test/test-nautilus-search-engine.c
@@ -13,7 +13,8 @@ hits_added_cb (NautilusSearchEngine *engine, GSList *hits)
}
static void
-finished_cb (NautilusSearchEngine *engine)
+finished_cb (NautilusSearchEngine *engine,
+ NautilusSearchProviderStatus status)
{
g_print ("finished!\n");
gtk_main_quit ();