aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-08-16 12:48:00 -0500
committerTed Gould <ted@gould.cx>2010-08-16 12:48:00 -0500
commitf1a43bb06d62093f1339d11e6981d73f2db653c5 (patch)
treeea66a9dc23e509881fdbcd624d6f5605f80c2031 /src
parentc712bf0af26111e53c475c82378cf72de4cc4e62 (diff)
parent72c93f2c3aea90bc18a694a723915f33701a021b (diff)
downloadlibayatana-appindicator-f1a43bb06d62093f1339d11e6981d73f2db653c5.tar.gz
libayatana-appindicator-f1a43bb06d62093f1339d11e6981d73f2db653c5.tar.bz2
libayatana-appindicator-f1a43bb06d62093f1339d11e6981d73f2db653c5.zip
* Upstream Merge
* Fixing approvers retiring off the bus
Diffstat (limited to 'src')
-rw-r--r--src/application-service-appstore.c12
1 files changed, 9 insertions, 3 deletions
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,