[nautilus] search-engine-recent: keep track of the running state using a boolean
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] search-engine-recent: keep track of the running state using a boolean
- Date: Wed, 28 Nov 2018 12:52:17 +0000 (UTC)
commit f4edaf79349910190a1e51a928ca6daa640863d1
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Tue Nov 27 15:31:07 2018 -0500
search-engine-recent: keep track of the running state using a boolean
We were using the cancellable to check if the engine was running,
but let's make this more explicit using a specific variable
src/nautilus-search-engine-recent.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-search-engine-recent.c b/src/nautilus-search-engine-recent.c
index a4350a8c3..52bfff5ca 100644
--- a/src/nautilus-search-engine-recent.c
+++ b/src/nautilus-search-engine-recent.c
@@ -40,6 +40,7 @@ struct _NautilusSearchEngineRecent
GObject parent_instance;
NautilusQuery *query;
+ gboolean running;
GCancellable *cancellable;
GtkRecentManager *recent_manager;
guint add_hits_idle_id;
@@ -103,6 +104,7 @@ search_thread_add_hits_idle (gpointer user_data)
DEBUG ("Recent engine add hits");
}
+ self->running = FALSE;
g_list_free_full (search_hits->hits, g_object_unref);
g_clear_object (&self->cancellable);
g_free (search_hits);
@@ -341,6 +343,7 @@ nautilus_search_engine_recent_start (NautilusSearchProvider *provider)
return;
}
+ self->running = TRUE;
self->cancellable = g_cancellable_new ();
thread = g_thread_new ("nautilus-search-recent", recent_thread_func,
g_object_ref (self));
@@ -358,6 +361,8 @@ nautilus_search_engine_recent_stop (NautilusSearchProvider *provider)
DEBUG ("Recent engine stop");
g_cancellable_cancel (self->cancellable);
}
+
+ self->running = FALSE;
}
static void
@@ -375,7 +380,7 @@ nautilus_search_engine_recent_is_running (NautilusSearchProvider *provider)
{
NautilusSearchEngineRecent *self = NAUTILUS_SEARCH_ENGINE_RECENT (provider);
- return self->cancellable != NULL;
+ return self->running;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]