aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog7
-rw-r--r--src/application-service-appstore.c12
2 files changed, 16 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index e7abf1c..150e247 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+indicator-application (0.2.4-0ubuntu2~ppa1~approver3) UNRELEASED; urgency=low
+
+ * Upstream Merge
+ * Fixing approvers retiring off the bus
+
+ -- Ted Gould <ted@ubuntu.com> Mon, 16 Aug 2010 12:47:25 -0500
+
indicator-application (0.2.4-0ubuntu2~ppa1~approver2) maverick; urgency=low
* Upstream Merge
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index 73fc5d1..30af2ea 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -75,6 +75,7 @@ typedef enum {
typedef struct _Approver Approver;
struct _Approver {
DBusGProxy * proxy;
+ gboolean destroy_by_proxy;
};
typedef struct _Application Application;
@@ -578,10 +579,12 @@ apply_status (Application * app)
ApplicationServiceAppstore * appstore = app->appstore;
ApplicationServiceAppstorePrivate * priv = appstore->priv;
+ /* g_debug("Applying status. Status: %d Approved by: %d Approvers: %d Visible: %d", app->status, g_list_length(app->approved_by), g_list_length(priv->approvers), app->visible_state); */
+
visible_state_t goal_state = VISIBLE_STATE_HIDDEN;
if (app->status != APP_INDICATOR_STATUS_PASSIVE &&
- g_list_length(app->approved_by) == g_list_length(priv->approvers)) {
+ g_list_length(app->approved_by) >= g_list_length(priv->approvers)) {
goal_state = VISIBLE_STATE_SHOWN;
}
@@ -1074,7 +1077,9 @@ approver_free (gpointer papprover, gpointer user_data)
g_list_foreach(appstore->priv->applications, remove_approver, approver->proxy);
if (approver->proxy != NULL) {
- g_object_unref(approver->proxy);
+ if (!approver->destroy_by_proxy) {
+ g_object_unref(approver->proxy);
+ }
approver->proxy = NULL;
}
@@ -1151,7 +1156,7 @@ approver_destroyed (gpointer pproxy, gpointer pappstore)
}
Approver * approver = (Approver *)lapprover->data;
- approver->proxy = NULL;
+ approver->destroy_by_proxy = TRUE;
appstore->priv->approvers = g_list_remove(appstore->priv->approvers, approver);
approver_free(approver, appstore);
@@ -1169,6 +1174,7 @@ application_service_appstore_approver_add (ApplicationServiceAppstore * appstore
ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE (appstore);
Approver * approver = g_new0(Approver, 1);
+ approver->destroy_by_proxy = FALSE;
GError * error = NULL;
approver->proxy = dbus_g_proxy_new_for_name_owner(priv->bus,