[gnome-settings-daemon] all: Name all the timeouts and idles



commit bdfcbd084a3dda9c5b35196725ab1fd8e883374f
Author: Bastien Nocera <hadess hadess net>
Date:   Fri May 16 15:03:25 2014 +0200

    all: Name all the timeouts and idles

 plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c  |    1 +
 plugins/clipboard/gsd-clipboard-manager.c          |    1 +
 plugins/common/test-plugin.h                       |    7 +++++--
 plugins/housekeeping/gsd-disk-space.c              |    3 +++
 plugins/housekeeping/gsd-housekeeping-manager.c    |    2 ++
 plugins/keyboard/gsd-keyboard-manager.c            |    1 +
 plugins/media-keys/gsd-media-keys-manager.c        |   14 ++++++++++----
 plugins/mouse/gsd-mouse-manager.c                  |    1 +
 plugins/orientation/gsd-orientation-manager.c      |    1 +
 plugins/power/gpm-common.c                         |   10 +++++++---
 plugins/power/gsd-power-manager.c                  |    1 +
 .../gsd-print-notifications-manager.c              |   20 ++++++++++++++++----
 plugins/smartcard/gsd-smartcard-manager.c          |    2 ++
 plugins/sound/gsd-sound-manager.c                  |    1 +
 plugins/wacom/gsd-wacom-manager.c                  |    2 ++
 plugins/wacom/gsd-wacom-osd-window.c               |    2 ++
 plugins/xsettings/fontconfig-monitor.c             |    1 +
 plugins/xsettings/gsd-xsettings-manager.c          |    2 ++
 18 files changed, 59 insertions(+), 13 deletions(-)
---
diff --git a/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c 
b/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
index 7a66ebd..b1b7771 100644
--- a/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
+++ b/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
@@ -732,6 +732,7 @@ gsd_a11y_keyboard_manager_start (GsdA11yKeyboardManager *manager,
         gnome_settings_profile_start (NULL);
 
         manager->priv->start_idle_id = g_idle_add ((GSourceFunc) start_a11y_keyboard_idle_cb, manager);
+        g_source_set_name_by_id (manager->priv->start_idle_id, "[gnome-settings-daemon] 
start_a11y_keyboard_idle_cb");
 
         gnome_settings_profile_end (NULL);
 
diff --git a/plugins/clipboard/gsd-clipboard-manager.c b/plugins/clipboard/gsd-clipboard-manager.c
index f64169f..c9d5276 100644
--- a/plugins/clipboard/gsd-clipboard-manager.c
+++ b/plugins/clipboard/gsd-clipboard-manager.c
@@ -945,6 +945,7 @@ gsd_clipboard_manager_start (GsdClipboardManager *manager,
         gnome_settings_profile_start (NULL);
 
         manager->priv->start_idle_id = g_idle_add ((GSourceFunc) start_clipboard_idle_cb, manager);
+        g_source_set_name_by_id (manager->priv->start_idle_id, "[gnome-settings-daemon] 
start_clipboard_idle_cb");
 
         gnome_settings_profile_end (NULL);
 
diff --git a/plugins/common/test-plugin.h b/plugins/common/test-plugin.h
index eb45388..f2ee501 100644
--- a/plugins/common/test-plugin.h
+++ b/plugins/common/test-plugin.h
@@ -76,8 +76,11 @@ main (int argc, char **argv)
                 exit (1);
         }
 
-       if (timeout > 0)
-               g_timeout_add_seconds (timeout, (GSourceFunc) gtk_main_quit, NULL);
+       if (timeout > 0) {
+               guint id;
+               id = g_timeout_add_seconds (timeout, (GSourceFunc) gtk_main_quit, NULL);
+               g_source_set_name_by_id (id, "[gnome-settings-daemon] gtk_main_quit");
+       }
 
        if (has_settings () == FALSE) {
                fprintf (stderr, "The schemas for plugin '%s' isn't available, check your installation.\n", 
SCHEMA_NAME);
diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c
index 53b9be8..c7ad85b 100644
--- a/plugins/housekeeping/gsd-disk-space.c
+++ b/plugins/housekeeping/gsd-disk-space.c
@@ -946,6 +946,7 @@ ldsm_mounts_changed (GObject  *monitor,
                 g_source_remove (ldsm_timeout_id);
         ldsm_timeout_id = g_timeout_add_seconds (CHECK_EVERY_X_SECONDS,
                                                  ldsm_check_all_mounts, NULL);
+        g_source_set_name_by_id (ldsm_timeout_id, "[gnome-settings-daemon] ldsm_check_all_mounts");
 }
 
 static gboolean
@@ -1027,8 +1028,10 @@ gsd_ldsm_setup (gboolean check_now)
 
         ldsm_timeout_id = g_timeout_add_seconds (CHECK_EVERY_X_SECONDS,
                                                  ldsm_check_all_mounts, NULL);
+        g_source_set_name_by_id (ldsm_timeout_id, "[gnome-settings-daemon] ldsm_check_all_mounts");
 
         purge_trash_id = g_timeout_add_seconds (3600, ldsm_purge_trash_and_temp, NULL);
+        g_source_set_name_by_id (purge_trash_id, "[gnome-settings-daemon] ldsm_purge_trash_and_temp");
 }
 
 void
diff --git a/plugins/housekeeping/gsd-housekeeping-manager.c b/plugins/housekeeping/gsd-housekeeping-manager.c
index 309d56c..ac15c2b 100644
--- a/plugins/housekeeping/gsd-housekeeping-manager.c
+++ b/plugins/housekeeping/gsd-housekeeping-manager.c
@@ -282,6 +282,7 @@ do_cleanup_soon (GsdHousekeepingManager *manager)
                 manager->priv->short_term_cb = g_timeout_add_seconds (INTERVAL_TWO_MINUTES,
                                                (GSourceFunc) do_cleanup_once,
                                                manager);
+                g_source_set_name_by_id (manager->priv->short_term_cb, "[gnome-settings-daemon] 
do_cleanup_once");
         }
 }
 
@@ -403,6 +404,7 @@ gsd_housekeeping_manager_start (GsdHousekeepingManager *manager,
         manager->priv->long_term_cb = g_timeout_add_seconds (INTERVAL_ONCE_A_DAY,
                                       (GSourceFunc) do_cleanup,
                                       manager);
+        g_source_set_name_by_id (manager->priv->long_term_cb, "[gnome-settings-daemon] do_cleanup");
 
         gnome_settings_profile_end (NULL);
 
diff --git a/plugins/keyboard/gsd-keyboard-manager.c b/plugins/keyboard/gsd-keyboard-manager.c
index d8ff930..0e566d7 100644
--- a/plugins/keyboard/gsd-keyboard-manager.c
+++ b/plugins/keyboard/gsd-keyboard-manager.c
@@ -1700,6 +1700,7 @@ gsd_keyboard_manager_start (GsdKeyboardManager *manager,
        }
 
         manager->priv->start_idle_id = g_idle_add ((GSourceFunc) start_keyboard_idle_cb, manager);
+        g_source_set_name_by_id (manager->priv->start_idle_id, "[gnome-settings-daemon] 
start_keyboard_idle_cb");
 
         gnome_settings_profile_end (NULL);
 
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 9604aed..f237573 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -468,9 +468,12 @@ grab_accelerators_complete (GObject      *object,
                 }
         }
 
-        if (retry)
-                g_timeout_add_seconds (SHELL_GRABBER_RETRY_INTERVAL,
-                                       retry_grabs, manager);
+        if (retry) {
+                guint id;
+                id = g_timeout_add_seconds (SHELL_GRABBER_RETRY_INTERVAL,
+                                            retry_grabs, manager);
+                g_source_set_name_by_id (id, "[gnome-settings-daemon] retry_grabs");
+        }
 }
 
 static void
@@ -1985,10 +1988,12 @@ screencast_start (GsdMediaKeysManager *manager)
 
         max_length = g_settings_get_int (manager->priv->settings, "max-screencast-length");
 
-        if (max_length > 0)
+        if (max_length > 0) {
                 manager->priv->screencast_timeout_id = g_timeout_add_seconds (max_length,
                                                                               screencast_timeout,
                                                                               manager);
+                g_source_set_name_by_id (manager->priv->screencast_timeout_id, "[gnome-settings-daemon] 
screencast_timeout");
+        }
         manager->priv->screencast_recording = TRUE;
 }
 
@@ -2404,6 +2409,7 @@ gsd_media_keys_manager_start (GsdMediaKeysManager *manager,
 #endif
 
         manager->priv->start_idle_id = g_idle_add ((GSourceFunc) start_media_keys_idle_cb, manager);
+        g_source_set_name_by_id (manager->priv->start_idle_id, "[gnome-settings-daemon] 
start_media_keys_idle_cb");
 
         register_manager (manager_object);
 
diff --git a/plugins/mouse/gsd-mouse-manager.c b/plugins/mouse/gsd-mouse-manager.c
index 04b0a3c..2cd4257 100644
--- a/plugins/mouse/gsd-mouse-manager.c
+++ b/plugins/mouse/gsd-mouse-manager.c
@@ -1263,6 +1263,7 @@ gsd_mouse_manager_start (GsdMouseManager *manager,
         }
 
         manager->priv->start_idle_id = g_idle_add ((GSourceFunc) gsd_mouse_manager_idle_cb, manager);
+        g_source_set_name_by_id (manager->priv->start_idle_id, "[gnome-settings-daemon] 
gsd_mouse_manager_idle_cb");
 
         gnome_settings_profile_end (NULL);
 
diff --git a/plugins/orientation/gsd-orientation-manager.c b/plugins/orientation/gsd-orientation-manager.c
index 22dbaea..b052012 100644
--- a/plugins/orientation/gsd-orientation-manager.c
+++ b/plugins/orientation/gsd-orientation-manager.c
@@ -442,6 +442,7 @@ gsd_orientation_manager_start (GsdOrientationManager *manager,
         gnome_settings_profile_start (NULL);
 
         manager->priv->start_idle_id = g_idle_add ((GSourceFunc) gsd_orientation_manager_idle_cb, manager);
+        g_source_set_name_by_id (manager->priv->start_idle_id, "[gnome-settings-daemon] 
gsd_orientation_manager_idle_cb");
 
         manager->priv->introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL);
         g_assert (manager->priv->introspection_data != NULL);
diff --git a/plugins/power/gpm-common.c b/plugins/power/gpm-common.c
index dbe610e..91d43bc 100644
--- a/plugins/power/gpm-common.c
+++ b/plugins/power/gpm-common.c
@@ -266,6 +266,7 @@ guint
 gsd_power_enable_screensaver_watchdog (void)
 {
         int dummy;
+        guint id;
 
         /* Make sure that Xorg's DPMS extension never gets in our
          * way. The defaults are now applied in Fedora 20 from
@@ -274,9 +275,11 @@ gsd_power_enable_screensaver_watchdog (void)
         if (DPMSQueryExtension(GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &dummy, &dummy))
                 DPMSSetTimeouts (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), 0, 0, 0);
         gdk_error_trap_pop_ignored ();
-        return g_timeout_add_seconds (XSCREENSAVER_WATCHDOG_TIMEOUT,
-                                      disable_builtin_screensaver,
-                                      NULL);
+        id = g_timeout_add_seconds (XSCREENSAVER_WATCHDOG_TIMEOUT,
+                                    disable_builtin_screensaver,
+                                    NULL);
+        g_source_set_name_by_id (id, "[gnome-settings-daemon] disable_builtin_screensaver");
+        return id;
 }
 
 static GnomeRROutput *
@@ -876,6 +879,7 @@ play_loop_start (guint *id)
         *id = g_timeout_add_seconds (GSD_POWER_MANAGER_CRITICAL_ALERT_TIMEOUT,
                                      (GSourceFunc) play_loop_timeout_cb,
                                      NULL);
+        g_source_set_name_by_id (*id, "[gnome-settings-daemon] play_loop_timeout_cb");
         play_sound ();
 }
 
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 4966fa1..7a50ef3 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -1733,6 +1733,7 @@ set_temporary_unidle_on_ac (GsdPowerManager *manager,
                 manager->priv->temporary_unidle_on_ac_id = g_timeout_add_seconds (POWER_UP_TIME_ON_AC,
                                                                                   (GSourceFunc) 
temporary_unidle_done_cb,
                                                                                   manager);
+                g_source_set_name_by_id (manager->priv->temporary_unidle_on_ac_id, "[gnome-settings-daemon] 
temporary_unidle_done_cb");
         }
 }
 
diff --git a/plugins/print-notifications/gsd-print-notifications-manager.c 
b/plugins/print-notifications/gsd-print-notifications-manager.c
index cc7cccd..120b503 100644
--- a/plugins/print-notifications/gsd-print-notifications-manager.c
+++ b/plugins/print-notifications/gsd-print-notifications-manager.c
@@ -90,6 +90,7 @@ struct GsdPrintNotificationsManagerPrivate
         guint                         cups_dbus_subscription_id;
         guint                         renew_source_id;
         gint                          last_notify_sequence_number;
+        guint                         start_idle_id;
 };
 
 enum {
@@ -691,6 +692,7 @@ process_cups_notification (GsdPrintNotificationsManager *manager,
                                                         data->manager = manager;
 
                                                         data->timeout_id = g_timeout_add_seconds 
(CONNECTING_TIMEOUT, show_notification, data);
+                                                        g_source_set_name_by_id (data->timeout_id, 
"[gnome-settings-daemon] show_notification");
                                                         manager->priv->timeouts = g_list_append 
(manager->priv->timeouts, data);
                                                 } else {
                                                         ReasonData *reason_data;
@@ -1176,16 +1178,19 @@ renew_subscription_timeout_enable (GsdPrintNotificationsManager *manager,
 
         if (enable) {
                 renew_subscription (manager);
-                if (with_connection_test)
+                if (with_connection_test) {
                         manager->priv->renew_source_id =
                                 g_timeout_add_seconds (RENEW_INTERVAL,
                                                        renew_subscription_with_connection_test,
                                                        manager);
-                else
+                        g_source_set_name_by_id (manager->priv->renew_source_id, "[gnome-settings-daemon] 
renew_subscription_with_connection_test");
+                } else {
                         manager->priv->renew_source_id =
                                 g_timeout_add_seconds (RENEW_INTERVAL,
                                                        renew_subscription,
                                                        manager);
+                        g_source_set_name_by_id (manager->priv->renew_source_id, "[gnome-settings-daemon] 
renew_subscription");
+                }
         } else {
                 manager->priv->renew_source_id = 0;
         }
@@ -1215,11 +1220,14 @@ cups_connection_test_cb (GObject      *source_object,
 
                 renew_subscription_timeout_enable (manager, TRUE, TRUE);
                 manager->priv->check_source_id = g_timeout_add_seconds (CHECK_INTERVAL, 
process_new_notifications, manager);
+                g_source_set_name_by_id (manager->priv->check_source_id, "[gnome-settings-daemon] 
process_new_notifications");
         } else {
                 g_debug ("Test connection to CUPS server \'%s:%d\' failed.", cupsServer (), ippPort ());
-                if (manager->priv->cups_connection_timeout_id == 0)
+                if (manager->priv->cups_connection_timeout_id == 0) {
                         manager->priv->cups_connection_timeout_id =
                                 g_timeout_add_seconds (CUPS_CONNECTION_TEST_INTERVAL, cups_connection_test, 
manager);
+                        g_source_set_name_by_id (manager->priv->cups_connection_timeout_id, 
"[gnome-settings-daemon] cups_connection_test");
+                }
         }
 }
 
@@ -1336,7 +1344,8 @@ gsd_print_notifications_manager_start (GsdPrintNotificationsManager *manager,
         manager->priv->cups_connection_timeout_id = 0;
         manager->priv->last_notify_sequence_number = -1;
 
-        g_idle_add (gsd_print_notifications_manager_start_idle, manager);
+        manager->priv->start_idle_id = g_idle_add (gsd_print_notifications_manager_start_idle, manager);
+        g_source_set_name_by_id (manager->priv->start_idle_id, "[gnome-settings-daemon] 
gsd_print_notifications_manager_start_idle");
 
         gnome_settings_profile_end (NULL);
 
@@ -1433,6 +1442,9 @@ gsd_print_notifications_manager_finalize (GObject *object)
 
         g_return_if_fail (manager->priv != NULL);
 
+        if (manager->priv->start_idle_id != 0)
+                g_source_remove (manager->priv->start_idle_id);
+
         G_OBJECT_CLASS (gsd_print_notifications_manager_parent_class)->finalize (object);
 }
 
diff --git a/plugins/smartcard/gsd-smartcard-manager.c b/plugins/smartcard/gsd-smartcard-manager.c
index b1fd52c..6c3c1cb 100644
--- a/plugins/smartcard/gsd-smartcard-manager.c
+++ b/plugins/smartcard/gsd-smartcard-manager.c
@@ -448,6 +448,7 @@ register_driver (GsdSmartcardManager *self,
                               (GDestroyNotify) destroy_driver_registration_operation);
 
         operation->idle_id = g_idle_add ((GSourceFunc) on_main_thread_to_register_driver, task);
+        g_source_set_name_by_id (operation->idle_id, "[gnome-settings-daemon] 
on_main_thread_to_register_driver");
 }
 
 static void
@@ -726,6 +727,7 @@ gsd_smartcard_manager_start (GsdSmartcardManager  *self,
         gnome_settings_profile_start (NULL);
 
         priv->start_idle_id = g_idle_add ((GSourceFunc) gsd_smartcard_manager_idle_cb, self);
+        g_source_set_name_by_id (priv->start_idle_id, "[gnome-settings-daemon] 
gsd_smartcard_manager_idle_cb");
 
         gnome_settings_profile_end (NULL);
 
diff --git a/plugins/sound/gsd-sound-manager.c b/plugins/sound/gsd-sound-manager.c
index 344dbe5..003437b 100644
--- a/plugins/sound/gsd-sound-manager.c
+++ b/plugins/sound/gsd-sound-manager.c
@@ -192,6 +192,7 @@ trigger_flush (GsdSoundManager *manager)
         /* We delay the flushing a bit so that we can coalesce
          * multiple changes into a single cache flush */
         manager->priv->timeout = g_timeout_add (500, (GSourceFunc) flush_cb, manager);
+        g_source_set_name_by_id (manager->priv->timeout, "[gnome-settings-daemon] flush_cb");
 }
 
 static void
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index 1670ae5..2b9c147 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -1705,6 +1705,7 @@ wacom_device_calibration_check (GsdWacomDevice  *device)
                         data->notification_timeout_id = g_timeout_add (SHOW_CALIBRATION_TIMEOUT,
                                                                        notify_need_for_calibration,
                                                                        data);
+                        g_source_set_name_by_id (data->notification_timeout_id, "[gnome-settings-daemon] 
notify_need_for_calibration");
                 }
         } else {
                 wacom_device_calibration_data_unset (device);
@@ -1871,6 +1872,7 @@ gsd_wacom_manager_start (GsdWacomManager *manager,
         register_manager (manager_object);
 
         manager->priv->start_idle_id = g_idle_add ((GSourceFunc) gsd_wacom_manager_idle_cb, manager);
+        g_source_set_name_by_id (manager->priv->start_idle_id, "[gnome-settings-daemon] 
gsd_wacom_manager_idle_cb");
 
         gnome_settings_profile_end (NULL);
 
diff --git a/plugins/wacom/gsd-wacom-osd-window.c b/plugins/wacom/gsd-wacom-osd-window.c
index 5311fac..0e00964 100644
--- a/plugins/wacom/gsd-wacom-osd-window.c
+++ b/plugins/wacom/gsd-wacom-osd-window.c
@@ -404,6 +404,7 @@ gsd_wacom_osd_button_set_active (GsdWacomOSDButton *osd_button,
                osd_button->priv->timeout_id = g_timeout_add (BUTTON_TIMER_STEP,
                                                              (GSourceFunc) gsd_wacom_osd_button_timer,
                                                              osd_button);
+               g_source_set_name_by_id (osd_button->priv->timeout_id, "[gnome-settings-daemon] 
gsd_wacom_osd_button_timer");
        } else if (osd_button->priv->next_state) {
                /* it was on and now should be on again */
                if (previous_state == active) {
@@ -1447,6 +1448,7 @@ gsd_wacom_osd_window_motion_notify_event (GtkWidget      *widget,
        window->priv->cursor_timeout = g_timeout_add_seconds (CURSOR_HIDE_TIMEOUT,
                                                              cursor_timeout_source_func,
                                                              window);
+       g_source_set_name_by_id (window->priv->cursor_timeout, "[gnome-settings-daemon] 
cursor_timeout_source_func");
 
        return FALSE;
 }
diff --git a/plugins/xsettings/fontconfig-monitor.c b/plugins/xsettings/fontconfig-monitor.c
index e84c97b..41e2aad 100644
--- a/plugins/xsettings/fontconfig-monitor.c
+++ b/plugins/xsettings/fontconfig-monitor.c
@@ -140,6 +140,7 @@ stuff_changed (GFileMonitor *monitor G_GNUC_UNUSED,
                 g_source_remove (handle->timeout);
 
         handle->timeout = g_timeout_add_seconds (TIMEOUT_SECONDS, update, data);
+        g_source_set_name_by_id (handle->timeout, "[gnome-settings-daemon] update");
 }
 
 
diff --git a/plugins/xsettings/gsd-xsettings-manager.c b/plugins/xsettings/gsd-xsettings-manager.c
index 739c269..3ca1085 100644
--- a/plugins/xsettings/gsd-xsettings-manager.c
+++ b/plugins/xsettings/gsd-xsettings-manager.c
@@ -426,6 +426,7 @@ queue_notify (GnomeXSettingsManager *manager)
                 return;
 
         manager->priv->notify_idle_id = g_idle_add (notify_idle, manager);
+        g_source_set_name_by_id (manager->priv->notify_idle_id, "[gnome-settings-daemon] notify_idle");
 }
 
 static double
@@ -900,6 +901,7 @@ start_fontconfig_monitor (GnomeXSettingsManager  *manager)
         fontconfig_cache_init ();
 
         manager->priv->start_idle_id = g_idle_add ((GSourceFunc) start_fontconfig_monitor_idle_cb, manager);
+        g_source_set_name_by_id (manager->priv->start_idle_id, "[gnome-settings-daemon] 
start_fontconfig_monitor_idle_cb");
 
         gnome_settings_profile_end (NULL);
 }


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