From 62d8c1c86b21ab250342900324565f1b95ac2da8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 Jan 2010 22:16:45 -0600 Subject: Handling the connected signal as well, making sure we emit it. --- libindicator/indicator-service-manager.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libindicator/indicator-service-manager.c b/libindicator/indicator-service-manager.c index 42160ee..9d56a9f 100644 --- a/libindicator/indicator-service-manager.c +++ b/libindicator/indicator-service-manager.c @@ -455,18 +455,24 @@ start_service_again_cb (gpointer data) static void start_service_again (IndicatorServiceManager * manager) { + IndicatorServiceManagerPrivate * priv = INDICATOR_SERVICE_MANAGER_GET_PRIVATE(manager); + /* Allow the restarting to be disabled */ if (g_getenv(TIMEOUT_ENV_NAME)) { + priv->connected = FALSE; + g_signal_emit(manager, signals[CONNECTION_CHANGE], 0, FALSE, TRUE); return; } - IndicatorServiceManagerPrivate * priv = INDICATOR_SERVICE_MANAGER_GET_PRIVATE(manager); - if (priv->restart_count == 0) { /* First time, do it in idle */ g_idle_add(start_service_again_cb, manager); } else { /* Not our first time 'round the block. Let's slow this down. */ + if (priv->connected) { + priv->connected = FALSE; + g_signal_emit(manager, signals[CONNECTION_CHANGE], 0, FALSE, TRUE); + } if (priv->restart_count > 16) priv->restart_count = 16; /* Not more than 1024x */ g_timeout_add((1 << priv->restart_count) * TIMEOUT_MULTIPLIER, start_service_again_cb, manager); -- cgit v1.2.3