diff options
author | Ted Gould <ted@gould.cx> | 2012-03-08 14:23:12 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-03-08 14:23:12 -0600 |
commit | 82ed1671c765eb0c71c6ef466d3ca4030a4298ce (patch) | |
tree | 8d1cbae5a19a1ef52a03662ef2ffae194af2caea | |
parent | 1cc048fcd81fa2b9bcae30cbdb31dd2789b4b567 (diff) | |
parent | e8c61c586ad9941d63043d1fed0db37b9c7c3ab0 (diff) | |
download | ayatana-indicator-messages-82ed1671c765eb0c71c6ef466d3ca4030a4298ce.tar.gz ayatana-indicator-messages-82ed1671c765eb0c71c6ef466d3ca4030a4298ce.tar.bz2 ayatana-indicator-messages-82ed1671c765eb0c71c6ef466d3ca4030a4298ce.zip |
Merge from U. Desktop
-rw-r--r-- | .pc/.quilt_patches | 1 | ||||
-rw-r--r-- | .pc/.quilt_series | 1 | ||||
-rw-r--r-- | .pc/.version | 1 | ||||
-rw-r--r-- | debian/changelog | 9 | ||||
-rw-r--r-- | debian/source/format | 1 | ||||
-rw-r--r-- | src/messages-service-dbus.c | 205 |
6 files changed, 7 insertions, 211 deletions
diff --git a/.pc/.quilt_patches b/.pc/.quilt_patches deleted file mode 100644 index 6857a8d..0000000 --- a/.pc/.quilt_patches +++ /dev/null @@ -1 +0,0 @@ -debian/patches diff --git a/.pc/.quilt_series b/.pc/.quilt_series deleted file mode 100644 index c206706..0000000 --- a/.pc/.quilt_series +++ /dev/null @@ -1 +0,0 @@ -series diff --git a/.pc/.version b/.pc/.version deleted file mode 100644 index 0cfbf08..0000000 --- a/.pc/.version +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/debian/changelog b/debian/changelog index 3dfcb2d..a746391 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,12 +1,17 @@ -indicator-messages (0.5.92-0ubuntu1~ppa1) precise; urgency=low +indicator-messages (0.5.92-0ubuntu1) precise; urgency=low + [ Ted Gould ] * New upstream release. * Fix goto handling (by removing) (LP: #937441, LP: #937438) * Tell accountsservice when user has messages for the benefit of LightDM. * Dropping debian/patches: Merged upstream - -- Ted Gould <ted@ubuntu.com> Thu, 23 Feb 2012 00:12:42 -0600 + [ Ken VanDine ] + * debian/source/format + - dropped "3.0 (quilt), it doesn't play well with bzr maintained packages + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 23 Feb 2012 02:48:09 -0500 indicator-messages (0.5.91-0ubuntu3) precise; urgency=low diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/src/messages-service-dbus.c b/src/messages-service-dbus.c index 2b72f2e..1585ac0 100644 --- a/src/messages-service-dbus.c +++ b/src/messages-service-dbus.c @@ -42,8 +42,6 @@ typedef struct _MessageServiceDbusPrivate MessageServiceDbusPrivate; struct _MessageServiceDbusPrivate { GDBusConnection * connection; - GCancellable * accounts_cancel; - GDBusProxy * accounts_user; gboolean dot; gboolean hidden; }; @@ -157,199 +155,9 @@ connection_cb (GObject * object, GAsyncResult * res, gpointer user_data) } static void -accounts_notify_cb (GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError * error = NULL; - GVariant * answer = g_dbus_proxy_call_finish(G_DBUS_PROXY(source_object), res, &error); - - if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - g_error_free(error); - return; /* Must exit before accessing freed memory */ - } - - MessageServiceDbusPrivate * priv = MESSAGE_SERVICE_DBUS_GET_PRIVATE(user_data); - - if (priv->accounts_cancel != NULL) { - g_object_unref(priv->accounts_cancel); - priv->accounts_cancel = NULL; - } - - if (error != NULL) { - g_warning("Unable to get notify accounts service of message status: %s", error->message); - g_error_free(error); - return; - } - - g_variant_unref (answer); -} - -static void -accounts_notify (MessageServiceDbus *self) -{ - MessageServiceDbusPrivate * priv = MESSAGE_SERVICE_DBUS_GET_PRIVATE(self); - - if (priv->accounts_user == NULL) - return; /* We're not able to talk to accounts service */ - - if (priv->accounts_cancel != NULL) { - /* Cancel old notify before starting new one */ - g_cancellable_cancel(priv->accounts_cancel); - g_object_unref(priv->accounts_cancel); - priv->accounts_cancel = NULL; - } - - priv->accounts_cancel = g_cancellable_new(); - g_dbus_proxy_call(priv->accounts_user, - "SetXHasMessages", - g_variant_new ("(b)", priv->dot), - G_DBUS_CALL_FLAGS_NONE, - -1, /* timeout */ - priv->accounts_cancel, - accounts_notify_cb, - self); -} - -static void -get_accounts_user_proxy_cb (GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError * error = NULL; - GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish(res, &error); - - if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - g_error_free(error); - return; /* Must exit before accessing freed memory */ - } - - MessageServiceDbusPrivate * priv = MESSAGE_SERVICE_DBUS_GET_PRIVATE(user_data); - - if (priv->accounts_cancel != NULL) { - g_object_unref(priv->accounts_cancel); - priv->accounts_cancel = NULL; - } - - if (error != NULL) { - g_warning("Unable to get proxy of accountsservice: %s", error->message); - g_error_free(error); - return; - } - - priv->accounts_user = proxy; - accounts_notify (MESSAGE_SERVICE_DBUS (user_data)); -} - -static void -get_accounts_user_find_user_cb (GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError * error = NULL; - GVariant * answer = g_dbus_proxy_call_finish(G_DBUS_PROXY(source_object), res, &error); - - /* We're done with main accounts proxy now */ - g_object_unref (source_object); - - if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - g_error_free(error); - return; /* Must exit before accessing freed memory */ - } - - MessageServiceDbusPrivate * priv = MESSAGE_SERVICE_DBUS_GET_PRIVATE(user_data); - - if (priv->accounts_cancel != NULL) { - g_object_unref(priv->accounts_cancel); - priv->accounts_cancel = NULL; - } - - if (error != NULL) { - g_warning("Unable to get object name of user from accountsservice: %s", error->message); - g_error_free(error); - return; - } - - if (!g_variant_is_of_type (answer, G_VARIANT_TYPE ("(o)"))) { - g_warning("Unexpected type from FindUserByName: %s", g_variant_get_type_string (answer)); - g_variant_unref(answer); - return; - } - - const gchar *path; - g_variant_get(answer, "(&o)", &path); - - priv->accounts_cancel = g_cancellable_new(); - g_dbus_proxy_new_for_bus(G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_NONE, - NULL, - "org.freedesktop.Accounts", - path, - "org.freedesktop.Accounts.User", - priv->accounts_cancel, - get_accounts_user_proxy_cb, - user_data); - - g_variant_unref (answer); -} - -static void -get_accounts_proxy_cb (GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError * error = NULL; - GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish(res, &error); - - if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - g_error_free(error); - return; /* Must exit before accessing freed memory */ - } - - MessageServiceDbusPrivate * priv = MESSAGE_SERVICE_DBUS_GET_PRIVATE(user_data); - - if (priv->accounts_cancel != NULL) { - g_object_unref(priv->accounts_cancel); - priv->accounts_cancel = NULL; - } - - if (error != NULL) { - g_warning("Unable to get proxy of accountsservice: %s", error->message); - g_error_free(error); - return; - } - - priv->accounts_cancel = g_cancellable_new(); - g_dbus_proxy_call(proxy, - "FindUserByName", - g_variant_new ("(s)", g_get_user_name ()), - G_DBUS_CALL_FLAGS_NONE, - -1, /* timeout */ - priv->accounts_cancel, - get_accounts_user_find_user_cb, - user_data); -} - -static void -get_accounts_proxy (MessageServiceDbus *self) -{ - MessageServiceDbusPrivate * priv = MESSAGE_SERVICE_DBUS_GET_PRIVATE(self); - - g_return_if_fail(priv->accounts_cancel == NULL); - - priv->accounts_cancel = g_cancellable_new(); - g_dbus_proxy_new_for_bus(G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_NONE, - NULL, - "org.freedesktop.Accounts", - "/org/freedesktop/Accounts", - "org.freedesktop.Accounts", - priv->accounts_cancel, - get_accounts_proxy_cb, - self); -} - -static void message_service_dbus_init (MessageServiceDbus *self) { g_bus_get(G_BUS_TYPE_SESSION, NULL, connection_cb, self); - get_accounts_proxy (self); MessageServiceDbusPrivate * priv = MESSAGE_SERVICE_DBUS_GET_PRIVATE(self); @@ -369,17 +177,6 @@ message_service_dbus_dispose (GObject *object) priv->connection = NULL; } - if (priv->accounts_cancel != NULL) { - g_cancellable_cancel(priv->accounts_cancel); - g_object_unref(priv->accounts_cancel); - priv->accounts_cancel = NULL; - } - - if (priv->accounts_user != NULL) { - g_object_unref(priv->accounts_user); - priv->accounts_user = NULL; - } - G_OBJECT_CLASS (message_service_dbus_parent_class)->dispose (object); return; } @@ -443,8 +240,6 @@ message_service_dbus_set_attention (MessageServiceDbus * self, gboolean attentio g_variant_new("(b)", priv->dot), NULL); } - - accounts_notify (self); } return; } |