aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-03-11 15:42:22 -0600
committerTed Gould <ted@gould.cx>2011-03-11 15:42:22 -0600
commita4e9c0bf6ee2b628dac8655cacd2841c87aae702 (patch)
tree9dda0b533e3422ba985e40eb62de09b5d6d8d8df /src
parentc6313acb0861e4861a160f6866e42995cd50f062 (diff)
downloadayatana-indicator-application-a4e9c0bf6ee2b628dac8655cacd2841c87aae702.tar.gz
ayatana-indicator-application-a4e9c0bf6ee2b628dac8655cacd2841c87aae702.tar.bz2
ayatana-indicator-application-a4e9c0bf6ee2b628dac8655cacd2841c87aae702.zip
If we're in the middle of a GetApplications and we get another signal, let's try again.
Diffstat (limited to 'src')
-rw-r--r--src/indicator-application.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/indicator-application.c b/src/indicator-application.c
index 1d074d6..73e8341 100644
--- a/src/indicator-application.c
+++ b/src/indicator-application.c
@@ -749,6 +749,21 @@ receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name,
GVariant * parameters, gpointer user_data)
{
IndicatorApplication * self = INDICATOR_APPLICATION(user_data);
+ IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(self);
+
+ /* If we're in the middle of a GetApplications call and we get
+ any of these our state is probably going to just be confused. Let's
+ cancel the call we had and try again to try and get a clear answer */
+ if (priv->get_apps_cancel != NULL) {
+ g_cancelable_cancel(priv->get_apps_cancel);
+ g_object_unref(priv->get_apps_cancel);
+
+ priv->get_apps_cancel = g_cancellable_new();
+
+ g_dbus_proxy_call(priv->service_proxy, "GetApplications", NULL,
+ G_DBUS_CALL_FLAGS_NONE, -1, priv->get_apps_cancel,
+ get_applications, self);
+ }
if (g_strcmp0(signal_name, "ApplicationAdded") == 0) {
const gchar * iconname;