aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-09-19 15:47:59 -0500
committerTed Gould <ted@gould.cx>2011-09-19 15:47:59 -0500
commitacb55ae08c5db4ef6b97778338487ba5afdab1b7 (patch)
treee347cf8cd4a0631041791256ca56e8085cd4f0b5
parent1e18b3992ad75f5c22fe1dc87eb4af16b4f8d27c (diff)
parentd4166414a95a4a7596f522d5def62dc0897af309 (diff)
downloadayatana-indicator-session-acb55ae08c5db4ef6b97778338487ba5afdab1b7.tar.gz
ayatana-indicator-session-acb55ae08c5db4ef6b97778338487ba5afdab1b7.tar.bz2
ayatana-indicator-session-acb55ae08c5db4ef6b97778338487ba5afdab1b7.zip
Only grab reboot after a second delay
-rw-r--r--src/apt-watcher.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/apt-watcher.c b/src/apt-watcher.c
index 1db9c94..d8bb7e2 100644
--- a/src/apt-watcher.c
+++ b/src/apt-watcher.c
@@ -177,8 +177,6 @@ apt_watcher_on_name_appeared (GDBusConnection *connection,
"the system bus",
name_owner);
- apt_watcher_query_reboot_status (user_data);
-
g_dbus_proxy_call (watcher->proxy,
"UpgradeSystem",
g_variant_new("(b)", TRUE),
@@ -299,6 +297,15 @@ apt_watcher_transaction_state_real_update_cb (AptTransaction* trans,
if (self->current_state != UPGRADE_IN_PROGRESS){
query_again = TRUE;
}
+ else{
+ if (self->reboot_query != 0){
+ g_source_remove (self->reboot_query);
+ self->reboot_query = 0;
+ }
+ self->reboot_query = g_timeout_add_seconds (1,
+ apt_watcher_query_reboot_status,
+ self);
+ }
self->current_state = state;
g_object_unref (G_OBJECT(self->current_transaction));
@@ -383,7 +390,7 @@ apt_watcher_query_reboot_status (gpointer data)
GVariant* reboot_result = g_dbus_proxy_get_cached_property (self->proxy,
"RebootRequired");
- gboolean reboot;
+ gboolean reboot = FALSE;
g_variant_get (reboot_result, "b", &reboot);
g_debug ("apt_watcher_query_reboot_status: reboot prop = %i", reboot);
if (reboot == FALSE){