aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2010-09-09 16:36:24 -0400
committerKen VanDine <ken.vandine@canonical.com>2010-09-09 16:36:24 -0400
commitd7a7c77f8c309eda8473cd562e8b831c2a84712b (patch)
treee05e67a043c4f30468569386b886d2b0484b6235 /src
parent5e8e9f50ac7572a60e04f3ec3f5d50b1114ed5ae (diff)
parent4054bd4adec4296a6b70a7820a9690cf17f3613e (diff)
downloadlibayatana-appindicator-d7a7c77f8c309eda8473cd562e8b831c2a84712b.tar.gz
libayatana-appindicator-d7a7c77f8c309eda8473cd562e8b831c2a84712b.tar.bz2
libayatana-appindicator-d7a7c77f8c309eda8473cd562e8b831c2a84712b.zip
releasing version 0.2.7-0ubuntu10.2.7-0ubuntu1
Diffstat (limited to 'src')
-rw-r--r--src/application-service-appstore.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index d5f9a81..7096382 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -72,6 +72,8 @@ typedef enum {
VISIBLE_STATE_SHOWN
} visible_state_t;
+#define STATE2STRING(x) ((x) == VISIBLE_STATE_HIDDEN ? "hidden" : "visible")
+
typedef struct _Approver Approver;
struct _Approver {
DBusGProxy * proxy;
@@ -129,6 +131,7 @@ static AppIndicatorCategory string_to_cat(const gchar * cat_string);
static void approver_free (gpointer papprover, gpointer user_data);
static void check_with_new_approver (gpointer papp, gpointer papprove);
static void check_with_old_approver (gpointer papprove, gpointer papp);
+static Application * find_application (ApplicationServiceAppstore * appstore, const gchar * address, const gchar * object);
G_DEFINE_TYPE (ApplicationServiceAppstore, application_service_appstore, G_TYPE_OBJECT);
@@ -485,6 +488,7 @@ get_position (Application * app) {
}
if (lapp == NULL) {
+ g_warning("Unable to find position for app '%s'", app->id);
return -1;
}
@@ -497,6 +501,7 @@ static void
application_free (Application * app)
{
if (app == NULL) return;
+ g_debug("Application free '%s'", app->id);
/* Handle the case where this could be called by unref'ing one of
the proxy objects. */
@@ -554,6 +559,7 @@ static void
application_removed_cb (DBusGProxy * proxy, gpointer userdata)
{
Application * app = (Application *)userdata;
+ g_debug("Application proxy destroyed '%s'", app->id);
/* Remove from the panel */
app->status = APP_INDICATOR_STATUS_PASSIVE;
@@ -600,6 +606,8 @@ apply_status (Application * app)
return;
}
+ g_debug("Changing app '%s' state from %s to %s", app->id, STATE2STRING(app->visible_state), STATE2STRING(goal_state));
+
/* This means we're going off line */
if (goal_state == VISIBLE_STATE_HIDDEN) {
gint position = get_position(app);
@@ -848,10 +856,20 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst
g_return_if_fail(dbus_name != NULL && dbus_name[0] != '\0');
g_return_if_fail(dbus_object != NULL && dbus_object[0] != '\0');
ApplicationServiceAppstorePrivate * priv = appstore->priv;
+ Application * app = find_application(appstore, dbus_name, dbus_object);
+
+ if (app != NULL) {
+ g_warning("Application already exists! Rerequesting properties.");
+ org_freedesktop_DBus_Properties_get_all_async(app->prop_proxy,
+ NOTIFICATION_ITEM_DBUS_IFACE,
+ get_all_properties_cb,
+ app);
+ return;
+ }
/* Build the application entry. This will be carried
along until we're sure we've got everything. */
- Application * app = g_new0(Application, 1);
+ app = g_new0(Application, 1);
app->validated = FALSE;
app->dbus_name = g_strdup(dbus_name);