From 079c2b517deba95385ac47eea1fd6560aef3aacb Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 Jan 2010 22:28:13 -0600 Subject: It's a fundamental mistake to believe that we can protect people using this interface from the disconnection. We have no information to say that the new service starting will come up in the same state as the one before it. We need the individual implementers to verify that. Now we need to fix that. This commit does so. --- libindicator/indicator-service-manager.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libindicator/indicator-service-manager.c b/libindicator/indicator-service-manager.c index 9d56a9f..891f49e 100644 --- a/libindicator/indicator-service-manager.c +++ b/libindicator/indicator-service-manager.c @@ -433,6 +433,11 @@ start_service (IndicatorServiceManager * service) static void service_proxy_destroyed (DBusGProxy * proxy, gpointer user_data) { + IndicatorServiceManagerPrivate * priv = INDICATOR_SERVICE_MANAGER_GET_PRIVATE(user_data); + if (priv->connected) { + priv->connected = FALSE; + g_signal_emit(G_OBJECT(user_data), signals[CONNECTION_CHANGE], 0, FALSE, TRUE); + } return start_service_again(INDICATOR_SERVICE_MANAGER(user_data)); } @@ -459,8 +464,6 @@ start_service_again (IndicatorServiceManager * 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; } @@ -469,10 +472,6 @@ start_service_again (IndicatorServiceManager * manager) 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