[gnome-logs/wip/batching: 2/4] Store idle handler ID in GlEventView



commit 53c60159d2cdee1ff2697861ecbd29e7591cf695
Author: David King <davidk gnome org>
Date:   Tue Feb 18 08:58:27 2014 +0000

    Store idle handler ID in GlEventView

 src/gl-eventview.c |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)
---
diff --git a/src/gl-eventview.c b/src/gl-eventview.c
index 4b6a90f..d270399 100644
--- a/src/gl-eventview.c
+++ b/src/gl-eventview.c
@@ -50,6 +50,7 @@ typedef struct
     GtkListBox *results_listbox;
     GQueue *pending_results;
     GList *results;
+    guint insert_idle_id;
 } GlEventViewPrivate;
 
 G_DEFINE_TYPE_WITH_PRIVATE (GlEventView, gl_event_view, GTK_TYPE_STACK)
@@ -300,7 +301,6 @@ insert_journal_query_devices (GlEventView *view,
     GlEventViewPrivate *priv;
     GList *l;
     gsize n_results;
-    guint idle_id;
 
     priv = gl_event_view_get_instance_private (view);
     priv->results = gl_journal_query (priv->journal, query);
@@ -320,8 +320,9 @@ insert_journal_query_devices (GlEventView *view,
         g_queue_push_tail (priv->pending_results, l->data);
     }
 
-    idle_id = g_idle_add ((GSourceFunc) insert_devices_idle, view);
-    g_source_set_name_by_id (idle_id, G_STRFUNC);
+    priv->insert_idle_id = g_idle_add ((GSourceFunc) insert_devices_idle,
+                                       view);
+    g_source_set_name_by_id (priv->insert_idle_id, G_STRFUNC);
 }
 
 static gboolean
@@ -383,7 +384,6 @@ insert_journal_query_security (GlEventView *view,
     GlEventViewPrivate *priv;
     GList *l;
     gsize n_results;
-    guint idle_id;
 
     priv = gl_event_view_get_instance_private (view);
     priv->results = gl_journal_query (priv->journal, query);
@@ -403,8 +403,9 @@ insert_journal_query_security (GlEventView *view,
         g_queue_push_tail (priv->pending_results, l->data);
     }
 
-    idle_id = g_idle_add ((GSourceFunc) insert_security_idle, view);
-    g_source_set_name_by_id (idle_id, G_STRFUNC);
+    priv->insert_idle_id = g_idle_add ((GSourceFunc) insert_security_idle,
+                                       view);
+    g_source_set_name_by_id (priv->insert_idle_id, G_STRFUNC);
 }
 
 static gboolean
@@ -461,7 +462,6 @@ insert_journal_query_simple (GlEventView *view,
     GlEventViewPrivate *priv;
     GList *l;
     gsize n_results;
-    guint idle_id;
 
     priv = gl_event_view_get_instance_private (view);
     priv->results = gl_journal_query (priv->journal, query);
@@ -480,8 +480,8 @@ insert_journal_query_simple (GlEventView *view,
         g_queue_push_tail (priv->pending_results, l->data);
     }
 
-    idle_id = g_idle_add ((GSourceFunc) insert_simple_idle, view);
-    g_source_set_name_by_id (idle_id, G_STRFUNC);
+    priv->insert_idle_id = g_idle_add ((GSourceFunc) insert_simple_idle, view);
+    g_source_set_name_by_id (priv->insert_idle_id, G_STRFUNC);
 }
 
 static gboolean
@@ -538,7 +538,6 @@ insert_journal_query_cmdline (GlEventView *view,
     GlEventViewPrivate *priv;
     GList *l;
     gsize n_results;
-    guint idle_id;
 
     priv = gl_event_view_get_instance_private (view);
     priv->results = gl_journal_query (priv->journal, query);
@@ -558,8 +557,9 @@ insert_journal_query_cmdline (GlEventView *view,
         g_queue_push_tail (priv->pending_results, l->data);
     }
 
-    idle_id = g_idle_add ((GSourceFunc) insert_cmdline_idle, view);
-    g_source_set_name_by_id (idle_id, G_STRFUNC);
+    priv->insert_idle_id = g_idle_add ((GSourceFunc) insert_cmdline_idle,
+                                       view);
+    g_source_set_name_by_id (priv->insert_idle_id, G_STRFUNC);
 }
 
 static void
@@ -994,6 +994,7 @@ gl_event_view_init (GlEventView *view)
     priv = gl_event_view_get_instance_private (view);
     priv->search_text = NULL;
     priv->active_listbox = NULL;
+    priv->insert_idle_id = 0;
     priv->journal = gl_journal_new ();
 
     /* TODO: Monitor and propagate any GSettings changes. */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]