[gnome-packagekit] Assign names to our idle sources when using new versions of glib2
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-packagekit] Assign names to our idle sources when using new versions of glib2
- Date: Sat, 5 Jun 2010 15:28:38 +0000 (UTC)
commit 29fbaaf39f5a80f315c6e59a8d200e2379d8e15b
Author: Richard Hughes <richard hughsie com>
Date: Sat Jun 5 16:28:27 2010 +0100
Assign names to our idle sources when using new versions of glib2
This makes it possible to profile more accurately using systemtap
src/gpk-animated-icon.c | 6 ++++++
src/gpk-application.c | 28 ++++++++++++++++++++++++----
src/gpk-auto-refresh.c | 28 ++++++++++++++++++++++++----
src/gpk-check-update.c | 11 ++++++++++-
src/gpk-dbus-service.c | 9 +++++++--
src/gpk-firmware.c | 15 +++++++++++++--
src/gpk-hardware.c | 13 +++++++++++--
src/gpk-modal-dialog.c | 3 +++
src/gpk-repo.c | 3 +++
src/gpk-service-pack.c | 6 +++++-
src/gpk-update-icon.c | 9 +++++++--
src/gpk-update-viewer.c | 28 +++++++++++++++++++++++-----
src/gpk-watch.c | 17 ++++++++++-------
13 files changed, 146 insertions(+), 30 deletions(-)
---
diff --git a/src/gpk-animated-icon.c b/src/gpk-animated-icon.c
index e10bfe0..6a73e4f 100644
--- a/src/gpk-animated-icon.c
+++ b/src/gpk-animated-icon.c
@@ -211,6 +211,9 @@ gpk_animated_icon_set_frame_delay (GpkAnimatedIcon *icon, guint delay_ms)
if (icon->animation_id != 0) {
g_source_remove (icon->animation_id);
icon->animation_id = g_timeout_add (icon->frame_delay, (GSourceFunc) gpk_animated_icon_update, icon);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (icon->animation_id, "[GpkAnimatedIcon] update from delay change");
+#endif
}
return TRUE;
@@ -244,6 +247,9 @@ gpk_animated_icon_enable_animation (GpkAnimatedIcon *icon, gboolean enabled)
/* start */
icon->frame_counter = 0;
icon->animation_id = g_timeout_add (icon->frame_delay, (GSourceFunc) gpk_animated_icon_update, icon);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (icon->animation_id, "[GpkAnimatedIcon] start update");
+#endif
gpk_animated_icon_update (icon);
return TRUE;
}
diff --git a/src/gpk-application.c b/src/gpk-application.c
index 59f031d..3d264cc 100644
--- a/src/gpk-application.c
+++ b/src/gpk-application.c
@@ -736,7 +736,14 @@ gpk_application_progress_cb (PkProgress *progress, PkProgressType type, GpkAppli
goto out;
/* only show after some time in the transaction */
- application->priv->status_id = g_timeout_add (GPK_UI_STATUS_SHOW_DELAY, (GSourceFunc) gpk_application_status_changed_timeout_cb, application);
+ application->priv->status_id =
+ g_timeout_add (GPK_UI_STATUS_SHOW_DELAY,
+ (GSourceFunc) gpk_application_status_changed_timeout_cb,
+ application);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (application->priv->status_id,
+ "[GpkApplication] status-changed");
+#endif
/* save for the callback */
application->priv->status_last = status;
@@ -1247,7 +1254,12 @@ gpk_application_clear_details (GpkApplication *application)
/* only clear the last data if it takes a little while, else we flicker the display */
if (application->priv->details_event_id > 0)
g_source_remove (application->priv->details_event_id);
- application->priv->details_event_id = g_timeout_add (200, (GSourceFunc) gpk_application_clear_details_really, application);
+ application->priv->details_event_id =
+ g_timeout_add (200, (GSourceFunc) gpk_application_clear_details_really, application);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (application->priv->details_event_id,
+ "[GpkApplication] clear-details");
+#endif
}
/**
@@ -2020,6 +2032,7 @@ gpk_application_install_packages_cb (PkTask *task, GAsyncResult *res, GpkApplica
GError *error = NULL;
PkError *error_code = NULL;
GtkWindow *window;
+ guint idle_id;
/* get the results */
results = pk_task_generic_finish (task, res, &error);
@@ -2044,7 +2057,10 @@ gpk_application_install_packages_cb (PkTask *task, GAsyncResult *res, GpkApplica
}
/* idle add in the background */
- g_idle_add ((GSourceFunc) gpk_application_perform_search_idle_cb, application);
+ idle_id = g_idle_add ((GSourceFunc) gpk_application_perform_search_idle_cb, application);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (idle_id, "[GpkApplication] search");
+#endif
/* find applications that were installed, and offer to run them */
gpk_application_run_installed (application, results);
@@ -2070,6 +2086,7 @@ gpk_application_remove_packages_cb (PkTask *task, GAsyncResult *res, GpkApplicat
GError *error = NULL;
PkError *error_code = NULL;
GtkWindow *window;
+ guint idle_id;
/* get the results */
results = pk_task_generic_finish (task, res, &error);
@@ -2094,7 +2111,10 @@ gpk_application_remove_packages_cb (PkTask *task, GAsyncResult *res, GpkApplicat
}
/* idle add in the background */
- g_idle_add ((GSourceFunc) gpk_application_perform_search_idle_cb, application);
+ idle_id = g_idle_add ((GSourceFunc) gpk_application_perform_search_idle_cb, application);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (idle_id, "[GpkApplication] search");
+#endif
/* clear if success */
pk_package_sack_clear (application->priv->package_sack);
diff --git a/src/gpk-auto-refresh.c b/src/gpk-auto-refresh.c
index 6000aa6..452329a 100644
--- a/src/gpk-auto-refresh.c
+++ b/src/gpk-auto-refresh.c
@@ -65,6 +65,7 @@ struct GpkAutoRefreshPrivate
gboolean force_get_updates_login;
guint force_get_updates_login_timeout_id;
guint timeout_id;
+ guint periodic_id;
UpClient *client;
GSettings *settings;
GpkSession *session;
@@ -380,9 +381,16 @@ gpk_auto_refresh_change_state (GpkAutoRefresh *arefresh)
if (force) {
/* don't immediately send the signal, if we are called during object initialization
* we need to wait until upper layers finish hooking up to the signal first. */
- if (arefresh->priv->force_get_updates_login_timeout_id == 0)
+ if (arefresh->priv->force_get_updates_login_timeout_id == 0) {
arefresh->priv->force_get_updates_login_timeout_id =
- g_timeout_add_seconds (GPK_UPDATES_LOGIN_TIMEOUT, (GSourceFunc) gpk_auto_refresh_maybe_get_updates_logon_cb, arefresh);
+ g_timeout_add_seconds (GPK_UPDATES_LOGIN_TIMEOUT,
+ (GSourceFunc) gpk_auto_refresh_maybe_get_updates_logon_cb,
+ arefresh);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (arefresh->priv->force_get_updates_login_timeout_id,
+ "[GpkAutoRefresh] maybe-get-updates");
+#endif
+ }
}
}
@@ -391,7 +399,11 @@ gpk_auto_refresh_change_state (GpkAutoRefresh *arefresh)
g_source_remove (arefresh->priv->timeout_id);
value = g_settings_get_int (arefresh->priv->settings, GPK_SETTINGS_SESSION_STARTUP_TIMEOUT);
egg_debug ("defering action for %i seconds", value);
- arefresh->priv->timeout_id = g_timeout_add_seconds (value, (GSourceFunc) gpk_auto_refresh_change_state_cb, arefresh);
+ arefresh->priv->timeout_id =
+ g_timeout_add_seconds (value, (GSourceFunc) gpk_auto_refresh_change_state_cb, arefresh);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (arefresh->priv->timeout_id, "[GpkAutoRefresh] change-state");
+#endif
return TRUE;
}
@@ -567,6 +579,7 @@ gpk_auto_refresh_init (GpkAutoRefresh *arefresh)
arefresh->priv->network_active = FALSE;
arefresh->priv->force_get_updates_login = FALSE;
arefresh->priv->timeout_id = 0;
+ arefresh->priv->periodic_id = 0;
arefresh->priv->force_get_updates_login_timeout_id = 0;
/* we need to know the updates frequency */
@@ -597,7 +610,12 @@ gpk_auto_refresh_init (GpkAutoRefresh *arefresh)
arefresh->priv->session_idle = gpk_session_get_idle (arefresh->priv->session);
/* we check this in case we miss one of the async signals */
- g_timeout_add_seconds (GPK_AUTO_REFRESH_PERIODIC_CHECK, gpk_auto_refresh_timeout_cb, arefresh);
+ arefresh->priv->periodic_id =
+ g_timeout_add_seconds (GPK_AUTO_REFRESH_PERIODIC_CHECK,
+ gpk_auto_refresh_timeout_cb, arefresh);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (arefresh->priv->periodic_id, "[GpkAutoRefresh] periodic check");
+#endif
/* check system state */
gpk_auto_refresh_change_state (arefresh);
@@ -619,6 +637,8 @@ gpk_auto_refresh_finalize (GObject *object)
if (arefresh->priv->timeout_id != 0)
g_source_remove (arefresh->priv->timeout_id);
+ if (arefresh->priv->periodic_id != 0)
+ g_source_remove (arefresh->priv->periodic_id);
if (arefresh->priv->force_get_updates_login_timeout_id != 0)
g_source_remove (arefresh->priv->force_get_updates_login_timeout_id);
diff --git a/src/gpk-check-update.c b/src/gpk-check-update.c
index b41e000..14ae481 100644
--- a/src/gpk-check-update.c
+++ b/src/gpk-check-update.c
@@ -490,6 +490,7 @@ gpk_check_update_update_system_finished_cb (PkTask *task, GAsyncResult *res, Gpk
PkResults *results;
GError *error = NULL;
PkError *error_code = NULL;
+ guint timer_id;
/* get the results */
results = pk_task_generic_finish (task, res, &error);
@@ -499,7 +500,11 @@ gpk_check_update_update_system_finished_cb (PkTask *task, GAsyncResult *res, Gpk
/* we failed, so re-get the update list */
gpk_check_update_set_gicon (cupdate, NULL);
- g_timeout_add_seconds (GPK_CHECK_UPDATE_FAILED_TASK_RECHECK_DELAY, (GSourceFunc) gpk_check_update_get_updates_post_update_cb, cupdate);
+ timer_id = g_timeout_add_seconds (GPK_CHECK_UPDATE_FAILED_TASK_RECHECK_DELAY,
+ (GSourceFunc) gpk_check_update_get_updates_post_update_cb, cupdate);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (timer_id, "[GpkCheckUpdate] failed");
+#endif
goto out;
}
@@ -1109,6 +1114,10 @@ gpk_check_update_updates_changed_cb (PkControl *control, GpkCheckUpdate *cupdate
cupdate->priv->updates_changed_id =
g_timeout_add_seconds (GPK_CHECK_UPDATE_UPDATES_CHANGED_TIMEOUT,
(GSourceFunc) gpk_check_update_query_updates_changed_cb, cupdate);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (cupdate->priv->updates_changed_id,
+ "[GpkCheckUpdate] updates-changed");
+#endif
}
/**
diff --git a/src/gpk-dbus-service.c b/src/gpk-dbus-service.c
index 59e7233..e3953ed 100644
--- a/src/gpk-dbus-service.c
+++ b/src/gpk-dbus-service.c
@@ -130,6 +130,7 @@ main (int argc, char *argv[])
guint retval = 0;
DBusGConnection *connection;
EggDbusMonitor *monitor;
+ guint timer_id = 0;
const GOptionEntry options[] = {
{ "no-timed-exit", '\0', 0, G_OPTION_ARG_NONE, &no_timed_exit,
@@ -189,8 +190,12 @@ main (int argc, char *argv[])
}
/* only timeout if we have specified iton the command line */
- if (!no_timed_exit)
- g_timeout_add_seconds (5, (GSourceFunc) gpk_dbus_service_check_idle_cb, dbus);
+ if (!no_timed_exit) {
+ timer_id = g_timeout_add_seconds (5, (GSourceFunc) gpk_dbus_service_check_idle_cb, dbus);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (timer_id, "[GpkDbusService] timed exit");
+#endif
+ }
/* wait */
g_main_loop_run (loop);
diff --git a/src/gpk-firmware.c b/src/gpk-firmware.c
index c73b06f..073bf09 100644
--- a/src/gpk-firmware.c
+++ b/src/gpk-firmware.c
@@ -879,6 +879,7 @@ gpk_firmware_scan_directory (GpkFirmware *firmware)
guint i;
GPtrArray *array;
const GpkFirmwareRequest *req;
+ guint scan_id = 0;
/* should we check and show the user */
ret = g_settings_get_boolean (firmware->priv->settings, GPK_SETTINGS_ENABLE_CHECK_FIRMWARE);
@@ -929,8 +930,12 @@ gpk_firmware_scan_directory (GpkFirmware *firmware)
}
/* don't spam the user at startup, so wait a little delay */
- if (array->len > 0)
- g_timeout_add_seconds (GPK_FIRMWARE_PROCESS_DELAY, gpk_firmware_timeout_cb, firmware);
+ if (array->len > 0) {
+ scan_id = g_timeout_add_seconds (GPK_FIRMWARE_PROCESS_DELAY, gpk_firmware_timeout_cb, firmware);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (scan_id, "[GpkFirmware] process");
+#endif
+ }
}
/**
@@ -959,6 +964,9 @@ gpk_firmware_monitor_changed_cb (GFileMonitor *monitor, GFile *file, GFile *othe
/* wait for the device to settle */
firmware->priv->timeout_id =
g_timeout_add_seconds (GPK_FIRMWARE_INSERT_DELAY, (GSourceFunc) gpk_firmware_scan_directory_cb, firmware);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (firmware->priv->timeout_id, "[GpkFirmware] changed");
+#endif
}
/**
@@ -1013,6 +1021,9 @@ out:
g_object_unref (file);
firmware->priv->timeout_id =
g_timeout_add_seconds (GPK_FIRMWARE_LOGIN_DELAY, (GSourceFunc) gpk_firmware_scan_directory_cb, firmware);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (firmware->priv->timeout_id, "[GpkFirmware] login coldplug");
+#endif
}
/**
diff --git a/src/gpk-hardware.c b/src/gpk-hardware.c
index ae012b2..b1fb451 100644
--- a/src/gpk-hardware.c
+++ b/src/gpk-hardware.c
@@ -242,14 +242,19 @@ gpk_hardware_device_added_timeout (gpointer data)
static void
gpk_hardware_device_added_cb (DBusGProxy *proxy, const gchar *udi, GpkHardware *hardware)
{
+ guint added_id;
+
egg_debug ("hardware added. udi=%s", udi);
/* we get multiple hal signals for one device plugin. Ignore all but first one.
TODO: should we act on a different one ?
*/
if (hardware->priv->udi == NULL) {
hardware->priv->udi = g_strdup (udi);
- g_timeout_add_seconds (GPK_HARDWARE_MULTIPLE_HAL_SIGNALS_DELAY,
+ added_id = g_timeout_add_seconds (GPK_HARDWARE_MULTIPLE_HAL_SIGNALS_DELAY,
gpk_hardware_device_added_timeout, hardware);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (added_id, "[GpkHardware] added");
+#endif
}
}
@@ -274,6 +279,7 @@ static void
gpk_hardware_init (GpkHardware *hardware)
{
gboolean ret;
+ guint login_id = 0;
GError *error = NULL;
hardware->priv = GPK_HARDWARE_GET_PRIVATE (hardware);
@@ -308,7 +314,10 @@ gpk_hardware_init (GpkHardware *hardware)
G_CALLBACK (gpk_hardware_device_added_cb), hardware, NULL);
/* check at startup (plus delay) and see if there is cold plugged hardware needing drivers */
- g_timeout_add_seconds (GPK_HARDWARE_LOGIN_DELAY, gpk_hardware_timeout_cb, hardware);
+ login_id = g_timeout_add_seconds (GPK_HARDWARE_LOGIN_DELAY, gpk_hardware_timeout_cb, hardware);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (login_id, "[GpkHardware] login");
+#endif
}
/**
diff --git a/src/gpk-modal-dialog.c b/src/gpk-modal-dialog.c
index 43f937e..b7ba566 100644
--- a/src/gpk-modal-dialog.c
+++ b/src/gpk-modal-dialog.c
@@ -383,6 +383,9 @@ gpk_modal_dialog_make_progressbar_pulse (GpkModalDialog *dialog)
progress_bar = GTK_PROGRESS_BAR (gtk_builder_get_object (dialog->priv->builder, "progressbar_percent"));
gtk_progress_bar_set_pulse_step (progress_bar, 0.04);
dialog->priv->pulse_timer_id = g_timeout_add (75, (GSourceFunc) gpk_modal_dialog_pulse_progress, dialog);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (dialog->priv->pulse_timer_id, "[GpkModalDialog] pulse");
+#endif
}
}
diff --git a/src/gpk-repo.c b/src/gpk-repo.c
index 1827661..e594de3 100644
--- a/src/gpk-repo.c
+++ b/src/gpk-repo.c
@@ -211,6 +211,9 @@ gpk_repo_progress_cb (PkProgress *progress, PkProgressType type, gpointer user_d
/* only show after some time in the transaction */
status_id = g_timeout_add (GPK_UI_STATUS_SHOW_DELAY, (GSourceFunc) gpk_repo_status_changed_timeout_cb, progress);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (status_id, "[GpkRepo] status");
+#endif
out:
return;
}
diff --git a/src/gpk-service-pack.c b/src/gpk-service-pack.c
index 8204a76..eef7b43 100644
--- a/src/gpk-service-pack.c
+++ b/src/gpk-service-pack.c
@@ -156,8 +156,12 @@ gpk_pack_set_percentage (guint percentage)
/* no info */
if (percentage == 101) {
/* set pulsing */
- if (pulse_id == 0)
+ if (pulse_id == 0) {
pulse_id = g_timeout_add (100, gpk_pack_percentage_pulse_cb, NULL);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (pulse_id, "[GpkServicePack] pulse");
+#endif
+ }
return;
}
diff --git a/src/gpk-update-icon.c b/src/gpk-update-icon.c
index 8382c38..be1b0a7 100644
--- a/src/gpk-update-icon.c
+++ b/src/gpk-update-icon.c
@@ -58,6 +58,7 @@ main (int argc, char *argv[])
GOptionContext *context;
UniqueApp *unique_app;
gboolean ret;
+ guint timer_id = 0;
const GOptionEntry options[] = {
{ "timed-exit", '\0', 0, G_OPTION_ARG_NONE, &timed_exit,
@@ -121,8 +122,12 @@ main (int argc, char *argv[])
hardware = gpk_hardware_new ();
/* Only timeout if we have specified iton the command line */
- if (timed_exit)
- g_timeout_add_seconds (120, (GSourceFunc) gtk_main_quit, NULL);
+ if (timed_exit) {
+ timer_id = g_timeout_add_seconds (120, (GSourceFunc) gtk_main_quit, NULL);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (timer_id, "[GpkUpdateIcon] timed exit");
+#endif
+ }
/* wait */
gtk_main ();
diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index 5205472..2a34a7e 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -286,7 +286,12 @@ gpk_update_viewer_check_restart (GpkUpdateViewer *update_viewer)
/* setup a callback so we autoclose */
g_object_set_data_full (G_OBJECT(dialog), "instance", g_object_ref (update_viewer), (GDestroyNotify) g_object_unref);
- priv->auto_shutdown_id = g_timeout_add_seconds (GPK_UPDATE_VIEWER_AUTO_RESTART_TIMEOUT, (GSourceFunc) gpk_update_viewer_auto_shutdown_cb, dialog);
+ priv->auto_shutdown_id =
+ g_timeout_add_seconds (GPK_UPDATE_VIEWER_AUTO_RESTART_TIMEOUT,
+ (GSourceFunc) gpk_update_viewer_auto_shutdown_cb, dialog);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (priv->auto_shutdown_id, "[GpkUpdateViewer] auto-restart");
+#endif
response = gtk_dialog_run (GTK_DIALOG(dialog));
gtk_widget_destroy (dialog);
@@ -572,7 +577,12 @@ gpk_update_viewer_update_packages_cb (PkTask *task, GAsyncResult *res, GpkUpdate
gtk_window_set_icon_name (GTK_WINDOW(dialog), GPK_ICON_SOFTWARE_INSTALLER);
/* setup a callback so we autoclose */
- priv->auto_shutdown_id = g_timeout_add_seconds (GPK_UPDATE_VIEWER_AUTO_RESTART_TIMEOUT, (GSourceFunc) gpk_update_viewer_auto_shutdown_cb, dialog);
+ priv->auto_shutdown_id =
+ g_timeout_add_seconds (GPK_UPDATE_VIEWER_AUTO_RESTART_TIMEOUT,
+ (GSourceFunc) gpk_update_viewer_auto_shutdown_cb, dialog);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (priv->auto_shutdown_id, "[GpkUpdateViewer] auto-shutdown");
+#endif
gtk_dialog_run (GTK_DIALOG(dialog));
gtk_widget_destroy (dialog);
@@ -677,9 +687,12 @@ gpk_update_viewer_add_active_row (GtkTreeModel *model, GtkTreePath *path)
}
/* add poll */
- if (active_row_timeout_id == 0)
+ if (active_row_timeout_id == 0) {
active_row_timeout_id = g_timeout_add (60, (GSourceFunc)gpk_update_viewer_pulse_active_rows, NULL);
-
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (active_row_timeout_id, "[GpkUpdateViewer] pulse row");
+#endif
+ }
active_rows = g_slist_prepend (active_rows, ref);
out:
return;
@@ -1445,7 +1458,12 @@ gpk_update_viewer_reconsider_info (GpkUpdateViewer *update_viewer)
gtk_window_set_icon_name (GTK_WINDOW(dialog), GPK_ICON_SOFTWARE_INSTALLER);
/* setup a callback so we autoclose */
- priv->auto_shutdown_id = g_timeout_add_seconds (GPK_UPDATE_VIEWER_AUTO_RESTART_TIMEOUT, (GSourceFunc) gpk_update_viewer_auto_shutdown_cb, dialog);
+ priv->auto_shutdown_id =
+ g_timeout_add_seconds (GPK_UPDATE_VIEWER_AUTO_RESTART_TIMEOUT,
+ (GSourceFunc) gpk_update_viewer_auto_shutdown_cb, dialog);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (priv->auto_shutdown_id, "[GpkUpdateViewer] shutdown no updates");
+#endif
gtk_dialog_run (GTK_DIALOG(dialog));
gtk_widget_destroy (dialog);
diff --git a/src/gpk-watch.c b/src/gpk-watch.c
index a1e6d52..ee4dffa 100644
--- a/src/gpk-watch.c
+++ b/src/gpk-watch.c
@@ -70,7 +70,7 @@ struct GpkWatchPrivate
PkTransactionList *tlist;
PkRestartEnum restart;
GSettings *settings;
- guint set_proxy_timeout;
+ guint set_proxy_id;
gchar *error_details;
gboolean hide_warning;
EggConsoleKit *console;
@@ -1111,7 +1111,7 @@ gpk_watch_set_proxy_cb (GObject *object, GAsyncResult *res, GpkWatch *watch)
gboolean ret;
/* we can run again */
- watch->priv->set_proxy_timeout = 0;
+ watch->priv->set_proxy_id = 0;
/* get the result */
ret = pk_control_set_proxy_finish (control, res, &error);
@@ -1151,12 +1151,15 @@ gpk_watch_set_proxies_ratelimit (GpkWatch *watch)
static gboolean
gpk_watch_set_proxies (GpkWatch *watch)
{
- if (watch->priv->set_proxy_timeout != 0) {
+ if (watch->priv->set_proxy_id != 0) {
egg_debug ("already scheduled");
return FALSE;
}
- watch->priv->set_proxy_timeout = g_timeout_add (GPK_WATCH_SET_PROXY_RATE_LIMIT,
+ watch->priv->set_proxy_id = g_timeout_add (GPK_WATCH_SET_PROXY_RATE_LIMIT,
(GSourceFunc) gpk_watch_set_proxies_ratelimit, watch);
+#if GLIB_CHECK_VERSION(2,25,8)
+ g_source_set_name_by_id (watch->priv->set_proxy_id, "[GpkWatch] set-proxies");
+#endif
return TRUE;
}
@@ -1797,7 +1800,7 @@ gpk_watch_init (GpkWatch *watch)
g_signal_connect (watch->priv->settings, "changed", G_CALLBACK (gpk_watch_key_changed_cb), watch);
watch->priv->status_icon = gtk_status_icon_new ();
- watch->priv->set_proxy_timeout = 0;
+ watch->priv->set_proxy_id = 0;
watch->priv->cached_messages = g_ptr_array_new_with_free_func ((GDestroyNotify) gpk_watch_cached_message_free);
watch->priv->restart_package_names = g_ptr_array_new_with_free_func (g_free);
watch->priv->task = PK_TASK(gpk_task_new ());
@@ -1857,8 +1860,8 @@ gpk_watch_finalize (GObject *object)
g_return_if_fail (watch->priv != NULL);
/* we might we waiting for a proxy update */
- if (watch->priv->set_proxy_timeout != 0)
- g_source_remove (watch->priv->set_proxy_timeout);
+ if (watch->priv->set_proxy_id != 0)
+ g_source_remove (watch->priv->set_proxy_id);
g_free (watch->priv->error_details);
g_free (watch->priv->transaction_id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]