diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2012-02-23 02:28:41 -0500 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2012-02-23 02:28:41 -0500 |
commit | d8efd5053bca6f02f962545d98f4758d1af26091 (patch) | |
tree | 927ebe28a694ed1e780b17898074644c922dabbb | |
parent | d46e55540fe81247f01ee500d72f2a8da1e96838 (diff) | |
parent | 1cc048fcd81fa2b9bcae30cbdb31dd2789b4b567 (diff) | |
download | ayatana-indicator-messages-d8efd5053bca6f02f962545d98f4758d1af26091.tar.gz ayatana-indicator-messages-d8efd5053bca6f02f962545d98f4758d1af26091.tar.bz2 ayatana-indicator-messages-d8efd5053bca6f02f962545d98f4758d1af26091.zip |
* 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
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | ChangeLog | 36 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | debian/changelog | 10 | ||||
-rw-r--r-- | debian/patches/series | 1 | ||||
-rw-r--r-- | debian/patches/tell-accounts-service.patch | 240 | ||||
-rw-r--r-- | src/status-items.c | 102 |
8 files changed, 102 insertions, 292 deletions
@@ -2,6 +2,7 @@ Allan LeSage Andrea Cimitan + Charles Kerr Chow Loong Jin Chris Coulson cody @@ -1,5 +1,41 @@ # Generated by Makefile. Do not edit. +2012-02-22 Ted Gould <ted@gould.cx> + + 0.5.92 + +2012-02-22 Ted Gould <ted@gould.cx> + + Remove unneeded goto's and clean up the code + +2012-02-21 Charles Kerr <charles.kerr@canonical.com> + + silence LP Bug #937438 - Coverity got confused by goto's and gave Coverity PW.BRANCH_PAST_INITIALIZATION - CID 10663 + +2012-02-21 Charles Kerr <charles.kerr@canonical.com> + + trivial: fix a comment typo + +2012-02-21 Charles Kerr <charles.kerr@canonical.com> + + trivial: fix error message grammar + +2012-02-21 Charles Kerr <charles.kerr@canonical.com> + + trivial: fix comment typo + +2012-02-21 Charles Kerr <charles.kerr@canonical.com> + + trivial: remove unnecessary cast + +2012-02-16 Michael Terry <michael.terry@canonical.com> + + tell accountsservices about whether the user has messages or not + +2012-02-15 Michael Terry <michael.terry@canonical.com> + + tell accounts service about message status + 2012-02-14 Ted Gould <ted@gould.cx> 0.5.91 @@ -2776,7 +2776,7 @@ fi # Define the identity of the package. PACKAGE=indicator-messages - VERSION=0.5.91 + VERSION=0.5.92 cat >>confdefs.h <<_ACEOF diff --git a/configure.ac b/configure.ac index 7fb043a..179d679 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-messages.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-messages, 0.5.91) +AM_INIT_AUTOMAKE(indicator-messages, 0.5.92) AM_MAINTAINER_MODE diff --git a/debian/changelog b/debian/changelog index 41e0896..3dfcb2d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +indicator-messages (0.5.92-0ubuntu1~ppa1) precise; urgency=low + + * 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 + indicator-messages (0.5.91-0ubuntu3) precise; urgency=low * debian/source/format: diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index e4b5738..0000000 --- a/debian/patches/series +++ /dev/null @@ -1 +0,0 @@ -tell-accounts-service.patch diff --git a/debian/patches/tell-accounts-service.patch b/debian/patches/tell-accounts-service.patch deleted file mode 100644 index 05b59f4..0000000 --- a/debian/patches/tell-accounts-service.patch +++ /dev/null @@ -1,240 +0,0 @@ -Index: indicator-messages/src/messages-service-dbus.c -=================================================================== ---- indicator-messages.orig/src/messages-service-dbus.c 2012-02-15 14:36:39.800065000 -0500 -+++ indicator-messages/src/messages-service-dbus.c 2012-02-15 14:39:02.823505930 -0500 -@@ -42,6 +42,8 @@ - struct _MessageServiceDbusPrivate - { - GDBusConnection * connection; -+ GCancellable * accounts_cancel; -+ GDBusProxy * accounts_user; - gboolean dot; - gboolean hidden; - }; -@@ -155,9 +157,199 @@ - } - - 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); - -@@ -177,6 +369,17 @@ - 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; - } -@@ -240,6 +443,8 @@ - g_variant_new("(b)", priv->dot), - NULL); - } -+ -+ accounts_notify (self); - } - return; - } diff --git a/src/status-items.c b/src/status-items.c index 25a7aa2..70a2ad9 100644 --- a/src/status-items.c +++ b/src/status-items.c @@ -253,62 +253,66 @@ module_destroy_in_idle (gpointer data) static gboolean load_status_provider (gpointer dir) { - gchar * provider = (gchar *)dir; - - if (!g_file_test(provider, G_FILE_TEST_EXISTS)) { - goto exit_final; - } - - g_debug("Loading status provider: %s", provider); - - GModule * module; - - module = g_module_open(provider, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); - if (module == NULL) { - g_warning("Unable to module for: %s", provider); - goto exit_module_fail; + gchar * provider = dir; + + /* load the module */ + GModule * module = NULL; + if (g_file_test(provider, G_FILE_TEST_EXISTS)) { + g_debug("Loading status provider: %s", provider); + module = g_module_open(provider, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); + if (module == NULL) { + g_warning("Unable to open module: %s", provider); + } } - /* Got it */ - GType (*type_func) (void); - if (!g_module_symbol(module, STATUS_PROVIDER_EXPORT_S, (gpointer *)&type_func)) { - g_warning("Unable to find type symbol in: %s", provider); - goto exit_module_fail; + /* find the status provider's GType */ + GType provider_type = 0; + if (module != NULL) { + GType (*type_func) (void); + if (!g_module_symbol(module, STATUS_PROVIDER_EXPORT_S, (gpointer *)&type_func)) { + g_warning("Unable to find type symbol in: %s", provider); + } else { + provider_type = type_func(); + if (provider_type == 0) { + g_warning("Unable to create type from: %s", provider); + } + } } - GType provider_type = type_func(); - if (provider_type == 0) { - g_warning("Unable to create type from: %s", provider); - goto exit_module_fail; + /* instantiate the status provider */ + StatusProvider * sprovider = NULL; + if (provider_type != 0) { + sprovider = STATUS_PROVIDER(g_object_new(provider_type, NULL)); + if (sprovider == NULL) { + g_warning("Unable to build provider from: %s", provider); + } } - StatusProvider * sprovider = STATUS_PROVIDER(g_object_new(provider_type, NULL)); - if (sprovider == NULL) { - g_warning("Unable to build provider from: %s", provider); - goto exit_module_fail; + /* use the provider */ + if (sprovider != NULL) { + /* On update let's talk to all of them and create the aggregate + value to export */ + g_signal_connect(G_OBJECT(sprovider), + STATUS_PROVIDER_SIGNAL_STATUS_CHANGED, + G_CALLBACK(update_status), NULL); + + /* Attach the module object to the status provider so + that when the status provider is free'd the module + is closed automatically. */ + g_object_set_data_full(G_OBJECT(sprovider), + "status-provider-module", + module, module_destroy_in_idle); + module = NULL; /* don't close module in this func */ + + status_providers = g_list_prepend(status_providers, sprovider); + + /* Force an update to ensure a consistent state */ + update_status(); } - /* On update let's talk to all of them and create the aggregate - value to export */ - g_signal_connect(G_OBJECT(sprovider), STATUS_PROVIDER_SIGNAL_STATUS_CHANGED, G_CALLBACK(update_status), NULL); - - /* Attach the module object to the status provider so - that when the status provider is free'd the module - is close automatically. */ - g_object_set_data_full(G_OBJECT(sprovider), "status-provider-module", module, module_destroy_in_idle); - - status_providers = g_list_prepend(status_providers, sprovider); - - /* Force and update every time just so we know we're - in a consistent state*/ - update_status(); - - goto exit_final; - -exit_module_fail: - g_module_close(module); - -exit_final: + /* cleanup */ + if (module != NULL) + g_module_close(module); g_free(provider); - return FALSE; + return FALSE; /* only call this idle func once */ } |