[gnome-photos] tracker-change-monitor: Move code to its own function



commit b6ec1075c135f00ac81e1a59d4e36b354cb21222
Author: Rafael Fonseca <r4f4rfs gmail com>
Date:   Mon Mar 21 17:23:46 2016 +0100

    tracker-change-monitor: Move code to its own function
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763908

 src/photos-tracker-change-monitor.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-tracker-change-monitor.c b/src/photos-tracker-change-monitor.c
index b07e854..478a04a 100644
--- a/src/photos-tracker-change-monitor.c
+++ b/src/photos-tracker-change-monitor.c
@@ -143,6 +143,17 @@ photos_tracker_change_monitor_add_event (PhotosTrackerChangeMonitor *self, Photo
 
 
 static void
+photos_tracker_change_monitor_remove_timeout (PhotosTrackerChangeMonitor *self)
+{
+  if (self->pending_events_id != 0)
+    {
+      g_source_remove (self->pending_events_id);
+      self->pending_events_id = 0;
+    }
+}
+
+
+static void
 photos_tracker_change_monitor_send_events (PhotosTrackerChangeMonitor *self, GHashTable *id_table, GQueue 
*events)
 {
   GList *l;
@@ -285,8 +296,7 @@ photos_tracker_change_monitor_add_pending_event (PhotosTrackerChangeMonitor *sel
 {
   PhotosTrackerChangeEvent *change_event;
 
-  if (self->pending_events_id != 0)
-    g_source_remove (self->pending_events_id);
+  photos_tracker_change_monitor_remove_timeout (self);
 
   g_hash_table_insert (self->unresolved_ids, GINT_TO_POINTER (event->subject), NULL);
   g_hash_table_insert (self->unresolved_ids, GINT_TO_POINTER (event->predicate), NULL);


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