[totem] all: Add names to timeouts and idles



commit f33d5882b1996a10bd6f70f0d1565a6aa6dca9a1
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Feb 28 21:17:18 2014 +0100

    all: Add names to timeouts and idles
    
    For easier debugging.

 src/backend/bacon-video-widget.c            |   16 +++++++++++++---
 src/plugins/gromit/totem-gromit.c           |    1 +
 src/plugins/screensaver/totem-screensaver.c |    1 +
 src/plugins/totem-plugins-engine.c          |    1 +
 src/totem-grilo.c                           |    1 +
 src/totem-object.c                          |    1 +
 6 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index ddca422..24dda20 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -709,6 +709,7 @@ schedule_hiding_popup (BaconVideoWidget *bvw)
 {
   unschedule_hiding_popup (bvw);
   bvw->priv->transition_timeout_id = g_timeout_add_seconds (POPUP_HIDING_TIMEOUT, (GSourceFunc) 
hide_popup_timeout_cb, bvw);
+  g_source_set_name_by_id (bvw->priv->transition_timeout_id, "[totem] hide_popup_timeout_cb");
 }
 
 static void
@@ -1756,6 +1757,7 @@ bvw_reconfigure_tick_timeout (BaconVideoWidget *bvw, guint msecs)
     GST_DEBUG ("adding tick timeout (at %ums)", msecs);
     bvw->priv->update_id =
       g_timeout_add (msecs, (GSourceFunc) bvw_query_timeout, bvw);
+    g_source_set_name_by_id (bvw->priv->update_id, "[totem] bvw_query_timeout");
   }
 }
 
@@ -1771,6 +1773,7 @@ bvw_reconfigure_fill_timeout (BaconVideoWidget *bvw, guint msecs)
     GST_DEBUG ("adding fill timeout (at %ums)", msecs);
     bvw->priv->fill_id =
       g_timeout_add (msecs, (GSourceFunc) bvw_query_buffering_timeout, bvw);
+    g_source_set_name_by_id (bvw->priv->fill_id, "[totem] bvw_query_buffering_timeout");
   }
 }
 
@@ -2041,8 +2044,10 @@ bvw_update_tags_delayed (BaconVideoWidget *bvw, GstTagList *tags, const gchar *t
   g_async_queue_lock (bvw->priv->tag_update_queue);
   g_async_queue_push_unlocked (bvw->priv->tag_update_queue, data);
 
-  if (bvw->priv->tag_update_id == 0)
+  if (bvw->priv->tag_update_id == 0) {
     bvw->priv->tag_update_id = g_idle_add ((GSourceFunc) bvw_update_tags_dispatcher, bvw);
+    g_source_set_name_by_id (bvw->priv->tag_update_id, "[totem] bvw_update_tags_dispatcher");
+  }
 
   g_async_queue_unlock (bvw->priv->tag_update_queue);
 }
@@ -2311,8 +2316,10 @@ bvw_bus_message_cb (GstBus * bus, GstMessage * message, BaconVideoWidget *bvw)
       GST_DEBUG ("EOS message");
       /* update slider one last time */
       bvw_query_timeout (bvw);
-      if (bvw->priv->eos_id == 0)
+      if (bvw->priv->eos_id == 0) {
         bvw->priv->eos_id = g_idle_add (bvw_signal_eos_delayed, bvw);
+        g_source_set_name_by_id (bvw->priv->eos_id, "[totem] bvw_signal_eos_delayed");
+      }
       break;
     case GST_MESSAGE_BUFFERING:
       bvw_handle_buffering_message (message, bvw);
@@ -5450,7 +5457,10 @@ notify_volume_cb (GObject             *object,
                  GParamSpec          *pspec,
                  BaconVideoWidget    *bvw)
 {
-  g_idle_add ((GSourceFunc) notify_volume_idle_cb, bvw);
+  guint id;
+
+  id = g_idle_add ((GSourceFunc) notify_volume_idle_cb, bvw);
+  g_source_set_name_by_id (id, "[totem] notify_volume_idle_cb");
 }
 
 /**
diff --git a/src/plugins/gromit/totem-gromit.c b/src/plugins/gromit/totem-gromit.c
index 7454943..f2ddb26 100644
--- a/src/plugins/gromit/totem-gromit.c
+++ b/src/plugins/gromit/totem-gromit.c
@@ -191,6 +191,7 @@ totem_gromit_clear (TotemGromitPlugin *plugin, gboolean now)
        launch (visibility_cmd);
        launch (clear_cmd);
        plugin->priv->id = g_timeout_add_seconds (INTERVAL, totem_gromit_timeout_cb, plugin);
+       g_source_set_name_by_id (plugin->priv->id, "[totem] totem_gromit_timeout_cb");
 }
 
 static gboolean
diff --git a/src/plugins/screensaver/totem-screensaver.c b/src/plugins/screensaver/totem-screensaver.c
index 4d137ae..2c4bf15 100644
--- a/src/plugins/screensaver/totem-screensaver.c
+++ b/src/plugins/screensaver/totem-screensaver.c
@@ -109,6 +109,7 @@ property_notify_cb (TotemObject *totem,
 
        if (totem_object_is_playing (totem) == FALSE) {
                pi->priv->uninhibit_timeout = g_timeout_add_seconds (5, (GSourceFunc) uninhibit_timeout_cb, 
pi);
+               g_source_set_name_by_id (pi->priv->uninhibit_timeout, "[totem] uninhibit_timeout_cb");
                return;
        }
 
diff --git a/src/plugins/totem-plugins-engine.c b/src/plugins/totem-plugins-engine.c
index 7871dfc..37744d6 100644
--- a/src/plugins/totem-plugins-engine.c
+++ b/src/plugins/totem-plugins-engine.c
@@ -188,6 +188,7 @@ totem_plugins_engine_init (TotemPluginsEngine *engine)
        /* Commented out because it's a no-op. A further section is commented out below, and more's commented 
out
         * in totem-python-module.c. */
        engine->priv->garbage_collect_id = g_timeout_add_seconds_full (G_PRIORITY_LOW, 20, 
garbage_collect_cb, engine, NULL);
+       g_source_set_name_by_id (engine->priv->garbage_collect_id, "[totem] garbage_collect_cb");
 }
 
 static void
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index 752ce09..e02b8a4 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -533,6 +533,7 @@ update_search_thumbnails (TotemGrilo *self)
        if (self->priv->thumbnail_update_id > 0)
                return;
        self->priv->thumbnail_update_id = g_idle_add_full (G_PRIORITY_LOW, (GSourceFunc) 
update_search_thumbnails_idle, self, NULL);
+       g_source_set_name_by_id (self->priv->thumbnail_update_id, "[totem] update_search_thumbnails_idle");
 }
 
 static void
diff --git a/src/totem-object.c b/src/totem-object.c
index 7158481..b1080d3 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -680,6 +680,7 @@ setup_save_timeout_cb (Totem    *totem,
                totem->save_timeout_id = g_timeout_add_seconds (TOTEM_SESSION_SAVE_TIMEOUT,
                                                                (GSourceFunc) save_session_timeout_cb,
                                                                totem);
+               g_source_set_name_by_id (totem->save_timeout_id, "[totem] save_session_timeout_cb");
        } else if (totem->save_timeout_id > 0) {
                g_source_remove (totem->save_timeout_id);
                totem->save_timeout_id = 0;


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