-- cgit v1.2.3 From 30f1ae42f91519b8f06660c8c352a5fefb301c4b Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 16 Jun 2010 09:50:48 +0200 Subject: Apply 0.3.8-1 changes * Merge Ubuntu package into Debian. Closes: #549999 * debian/copyright: + Update to machine readable format. * debian/control: + Drop cdbs Build-Dep, bump debhelper to >=7. + Standards-Version 3.8.4. + Update Vcs-* fields. + Drop GNOME from Description, the package is not GNOME specific. + Slightly update Description, thanks lintian. * debian/rules: + Use minimal debhelper 7 rules without cdbs. + Disable tests for now, they fail (launchpad 587811) * debian/source/format: + Add file, make package 3.0 (quilt). --- debian/changelog | 21 ++++++++++++++++++++- debian/control | 18 +++++++++--------- debian/copyright | 42 +++++++++++++----------------------------- debian/rules | 12 +++++++++--- debian/source/format | 1 + 5 files changed, 52 insertions(+), 42 deletions(-) create mode 100644 debian/source/format diff --git a/debian/changelog b/debian/changelog index 4abbcdd..cd22c14 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +libindicator (0.3.8-1) unstable; urgency=low + + * Merge Ubuntu package into Debian. + Closes: #549999 + * debian/copyright: + + Update to machine readable format. + * debian/control: + + Drop cdbs Build-Dep, bump debhelper to >=7. + + Standards-Version 3.8.4. + + Update Vcs-* fields. + + Drop GNOME from Description, the package is not GNOME specific. + + Slightly update Description, thanks lintian. + * debian/rules: + + Use minimal debhelper 7 rules without cdbs. + + Disable tests for now, they fail (launchpad 587811) + * debian/source/format: + + Add file, make package 3.0 (quilt). + + -- Evgeni Golov Mon, 07 Jun 2010 11:21:32 +0200 + libindicator (0.3.8-0ubuntu1) lucid; urgency=low * New upstream release. @@ -142,4 +162,3 @@ libindicator (0.2.0~bzr325-0ubuntu1) karmic; urgency=low * debian/control: Fix Vcs-* links. -- Ken VanDine Tue, 25 Aug 2009 08:35:00 +0200 - diff --git a/debian/control b/debian/control index 686f637..6edb124 100644 --- a/debian/control +++ b/debian/control @@ -1,30 +1,30 @@ Source: libindicator Section: libs Priority: optional -Maintainer: Ubuntu Core Developers -Build-Depends: debhelper (>= 5.0), - cdbs (>= 0.4.41), +Maintainer: Evgeni Golov +Uploaders: Kartik Mistry +Build-Depends: debhelper (>= 7.0.50~), libglib2.0-dev (>= 2.22), libgtk2.0-dev (>= 2.12.0), libdbus-glib-1-dev, libtool, intltool, gtk-doc-tools -Standards-Version: 3.8.0 +Standards-Version: 3.8.4 Homepage: https://launchpad.net/libindicator -Vcs-Bzr: https://code.launchpad.net/~ubuntu-desktop/libindicator/ubuntu -Vcs-Browser: http://bazaar.launchpad.net/~ubuntu-desktop/libindicator/ubuntu +Vcs-Git: git://git.debian.org/collab-maint/libindicator.git +Vcs-Browser: http://git.debian.org/?p=collab-maint/libindicator.git Package: libindicator0 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: GNOME panel indicator applet - shared library +Description: panel indicator applet - shared library This library contains information to build indicators to go into the indicator applet. . - This package contains files that are needed to build applications. + This package contains the library itself. Package: libindicator-dev Section: libdevel @@ -33,7 +33,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, libgtk2.0-dev (>= 2.12.0), libindicator0 (= ${binary:Version}) -Description: GNOME panel indicator applet - shared library +Description: panel indicator applet - library development files This library contains information to build indicators to go into the indicator applet. . diff --git a/debian/copyright b/debian/copyright index ca1ebdd..f47fefc 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,33 +1,17 @@ -This package was debianized by Ted Gould on -Wed, 11 Feb 2009 15:41:06 -0600. +Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 +Name: libindicator +Maintainer: Ted Gould +Source: https://launchpad.net/libindicator -It was downloaded from +Files: * +Copyright: 2009-2010 Ted Gould , Canonical Ltd. +License: GPL-3 -Upstream Author: - - Ted Gould - -Copyright: - - Copyright (C) 2009 Canonical Ltd. - -License: - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, version 3 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Files: debian/* +Copyright: 2009-2010 Evgeni Golov +Copyright: 2009-2010 Ted Gould , Canonical Ltd. +License: GPL-3 +License: GPL-3 On Debian systems, the complete text of the GNU General -Public License can be found in `/usr/share/common-licenses/GPL-3'. - -The Debian packaging is (C) 2009, Canonical Ltd. and -is licensed under the GPLv3, see `/usr/share/common-licenses/GPL-3'. + Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'. diff --git a/debian/rules b/debian/rules index 151c78d..9612514 100755 --- a/debian/rules +++ b/debian/rules @@ -1,8 +1,14 @@ #!/usr/bin/make -f -include /usr/share/cdbs/1/rules/debhelper.mk -include /usr/share/cdbs/1/class/gnome.mk +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 LDFLAGS += -Wl,-z,defs -Wl,--as-needed -DEB_DH_MAKESHLIBS_ARGS_libindicator0 += -V 'libindicator0 (>= 0.3.6)' +%: + dh $@ + +override_dh_auto_test: + +override_dh_makeshlibs: + dh_makeshlibs -V 'libindicator0 (>= 0.3.6)' diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) -- cgit v1.2.3 From e3df28309fff9d052b6474821870beb724b64ce5 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 16 Jun 2010 09:52:28 +0200 Subject: Revert cdbs drop, as requested by the Ubuntu maintainers. --- debian/changelog | 6 ++++++ debian/control | 3 ++- debian/rules | 12 +++--------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index cd22c14..4a78988 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libindicator (0.3.8-2) unstable; urgency=low + + * Revert cdbs drop, as requested by the Ubuntu maintainers. + + -- Evgeni Golov Wed, 16 Jun 2010 09:51:54 +0200 + libindicator (0.3.8-1) unstable; urgency=low * Merge Ubuntu package into Debian. diff --git a/debian/control b/debian/control index 6edb124..8748c62 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,8 @@ Section: libs Priority: optional Maintainer: Evgeni Golov Uploaders: Kartik Mistry -Build-Depends: debhelper (>= 7.0.50~), +Build-Depends: debhelper (>= 5.0), + cdbs (>= 0.4.41), libglib2.0-dev (>= 2.22), libgtk2.0-dev (>= 2.12.0), libdbus-glib-1-dev, diff --git a/debian/rules b/debian/rules index 9612514..151c78d 100755 --- a/debian/rules +++ b/debian/rules @@ -1,14 +1,8 @@ #!/usr/bin/make -f -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/gnome.mk LDFLAGS += -Wl,-z,defs -Wl,--as-needed -%: - dh $@ - -override_dh_auto_test: - -override_dh_makeshlibs: - dh_makeshlibs -V 'libindicator0 (>= 0.3.6)' +DEB_DH_MAKESHLIBS_ARGS_libindicator0 += -V 'libindicator0 (>= 0.3.6)' -- cgit v1.2.3 From 34b4a4d73f886573fc992d0618f44817ec12c3a5 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 16 Jun 2010 09:55:10 +0200 Subject: Update Maintainer and Vcs-* fields for pkg-ayatana. --- debian/changelog | 3 ++- debian/control | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4a78988..b9f01e2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ libindicator (0.3.8-2) unstable; urgency=low * Revert cdbs drop, as requested by the Ubuntu maintainers. + * Update Maintainer and Vcs-* fields for pkg-ayatana. - -- Evgeni Golov Wed, 16 Jun 2010 09:51:54 +0200 + -- Evgeni Golov Wed, 16 Jun 2010 09:54:50 +0200 libindicator (0.3.8-1) unstable; urgency=low diff --git a/debian/control b/debian/control index 8748c62..5e1dfe8 100644 --- a/debian/control +++ b/debian/control @@ -1,8 +1,8 @@ Source: libindicator Section: libs Priority: optional -Maintainer: Evgeni Golov -Uploaders: Kartik Mistry +Maintainer: The Ayatana Packagers +Uploaders: Evgeni Golov , Kartik Mistry Build-Depends: debhelper (>= 5.0), cdbs (>= 0.4.41), libglib2.0-dev (>= 2.22), @@ -13,8 +13,8 @@ Build-Depends: debhelper (>= 5.0), gtk-doc-tools Standards-Version: 3.8.4 Homepage: https://launchpad.net/libindicator -Vcs-Git: git://git.debian.org/collab-maint/libindicator.git -Vcs-Browser: http://git.debian.org/?p=collab-maint/libindicator.git +Vcs-Bzr: http://bzr.debian.org/bzr/pkg-ayatana/libindicator/debian +Vcs-Browser: http://bzr.debian.org/loggerhead/pkg-ayatana/libindicator/debian Package: libindicator0 Section: libs -- cgit v1.2.3 From 589e659020e5653c8a2f4e83b9fdc440d43272a3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 16 Jun 2010 13:29:19 -0500 Subject: releasing version 0.3.8-2ubuntu1~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8b624a2..c6db7f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -libindicator (0.3.8-2ubuntu1~ppa1) UNRELEASED; urgency=low +libindicator (0.3.8-2ubuntu1~ppa1) lucid; urgency=low * Merge debian changes * Drop debian/source/* * debian/control: Switch VCS for this branch to be the indicator applet developers branch. - -- Ted Gould Wed, 16 Jun 2010 13:27:29 -0500 + -- Ted Gould Wed, 16 Jun 2010 13:29:16 -0500 libindicator (0.3.8-2) unstable; urgency=low -- cgit v1.2.3 From 149de106bfb648c17ac345eaedaa701ee427f0c4 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Jul 2010 09:47:12 -0500 Subject: Removing the style lookup that wasn't used. --- libindicator/indicator-image-helper.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/libindicator/indicator-image-helper.c b/libindicator/indicator-image-helper.c index 86d6c25..2492227 100644 --- a/libindicator/indicator-image-helper.c +++ b/libindicator/indicator-image-helper.c @@ -40,18 +40,6 @@ refresh_image (GtkImage * image) gint icon_size = 22; - GtkStyle * style = gtk_widget_get_style(GTK_WIDGET(image)); - GValue styleprop = {0}; - gtk_style_get_style_property(style, GTK_TYPE_IMAGE, "x-ayatana-indicator-dynamic", &styleprop); - - if (G_VALUE_HOLDS_BOOLEAN(&styleprop) && g_value_get_boolean(&styleprop)) { - PangoContext * context = gtk_widget_get_pango_context(GTK_WIDGET(image)); - PangoFontMetrics * metrics = pango_context_get_metrics(context, style->font_desc, pango_context_get_language(context)); - icon_size = PANGO_PIXELS(pango_font_metrics_get_ascent(metrics)) + PANGO_PIXELS(pango_font_metrics_get_descent(metrics)); - g_debug("Looking for icon size %d", icon_size); - pango_font_metrics_unref(metrics); - } - /* Look through the themes for that icon */ GtkIconInfo * icon_info = gtk_icon_theme_lookup_by_gicon(default_theme, icon_names, icon_size, 0); if (icon_info == NULL) { -- cgit v1.2.3 From 8a1255676ed6c7091e9c1c2dfda183dacf00ab31 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Jul 2010 10:36:27 -0500 Subject: Switching the watchers data structure over to a hashtable. --- libindicator/indicator-service.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index fc3c7de..74b5a2e 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -51,7 +51,7 @@ struct _IndicatorServicePrivate { gchar * name; DBusGProxy * dbus_proxy; guint timeout; - GList * watchers; + GHashTable * watchers; guint this_service_version; }; @@ -160,6 +160,8 @@ indicator_service_init (IndicatorService *self) priv->watchers = NULL; priv->this_service_version = 0; + priv->watchers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref); + /* Start talkin' dbus */ GError * error = NULL; DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_STARTER, &error); @@ -230,8 +232,7 @@ indicator_service_finalize (GObject *object) } if (priv->watchers != NULL) { - g_list_foreach(priv->watchers, (GFunc)g_free, NULL); - g_list_free(priv->watchers); + g_hash_table_destroy(priv->watchers); priv->watchers = NULL; } @@ -382,8 +383,12 @@ _indicator_service_server_watch (IndicatorService * service, DBusGMethodInvocati g_return_val_if_fail(INDICATOR_IS_SERVICE(service), FALSE); IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(service); - priv->watchers = g_list_append(priv->watchers, - g_strdup(dbus_g_method_get_sender(method))); + const gchar * sender = dbus_g_method_get_sender(method); + if (g_hash_table_lookup(priv->watchers, sender) == NULL) { + DBusGProxy * senderproxy = (gpointer)1; + + g_hash_table_insert(priv->watchers, g_strdup(sender), senderproxy); + } if (priv->timeout != 0) { g_source_remove(priv->timeout); @@ -394,13 +399,6 @@ _indicator_service_server_watch (IndicatorService * service, DBusGMethodInvocati return TRUE; } -/* Mung g_strcmp0 into GCompareFunc */ -static gint -find_watcher (gconstpointer a, gconstpointer b) -{ - return g_strcmp0((const gchar *)a, (const gchar *)b); -} - /* A function connecting into the dbus interface for the "UnWatch" function. It is also an async function to get the sender. It then looks the sender up and removes them @@ -413,19 +411,17 @@ _indicator_service_server_un_watch (IndicatorService * service, DBusGMethodInvoc IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(service); /* Remove us from the watcher list here */ - GList * watcher_item = g_list_find_custom(priv->watchers, dbus_g_method_get_sender(method), find_watcher); + gpointer watcher_item = g_hash_table_lookup(priv->watchers, dbus_g_method_get_sender(method)); if (watcher_item != NULL) { /* Free the watcher */ - gchar * name = watcher_item->data; - priv->watchers = g_list_remove(priv->watchers, name); - g_free(name); + g_hash_table_remove(priv->watchers, dbus_g_method_get_sender(method)); } else { /* Odd that we couldn't find the person, but, eh */ g_warning("Unable to find watcher who is unwatching: %s", dbus_g_method_get_sender(method)); } /* If we're out of watchers set the timeout for shutdown */ - if (priv->watchers == NULL) { + if (g_hash_table_size(priv->watchers) == 0) { if (priv->timeout != 0) { /* This should never really happen, but let's ensure that bad things don't happen if it does. */ -- cgit v1.2.3 From 632c3f997f091be8daeedcd0eaf7f1043dca5530 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Jul 2010 10:39:12 -0500 Subject: Making ths bus tracked in the private structure --- libindicator/indicator-service.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index 74b5a2e..d3e873b 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -50,6 +50,7 @@ typedef struct _IndicatorServicePrivate IndicatorServicePrivate; struct _IndicatorServicePrivate { gchar * name; DBusGProxy * dbus_proxy; + DBusGConnection * bus; guint timeout; GHashTable * watchers; guint this_service_version; @@ -158,13 +159,14 @@ indicator_service_init (IndicatorService *self) priv->dbus_proxy = NULL; priv->timeout = 0; priv->watchers = NULL; + priv->bus = NULL; priv->this_service_version = 0; priv->watchers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref); /* Start talkin' dbus */ GError * error = NULL; - DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_STARTER, &error); + priv->bus = dbus_g_bus_get(DBUS_BUS_STARTER, &error); if (error != NULL) { g_error("Unable to get starter bus: %s", error->message); g_error_free(error); @@ -173,7 +175,7 @@ indicator_service_init (IndicatorService *self) /* I think this should automatically, but I can't find confirmation of that, so we're putting the extra little code in here. */ error = NULL; - bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); + priv->bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); if (error != NULL) { g_error("Unable to get session bus: %s", error->message); g_error_free(error); @@ -181,7 +183,7 @@ indicator_service_init (IndicatorService *self) } } - priv->dbus_proxy = dbus_g_proxy_new_for_name_owner(bus, + priv->dbus_proxy = dbus_g_proxy_new_for_name_owner(priv->bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, @@ -192,7 +194,7 @@ indicator_service_init (IndicatorService *self) return; } - dbus_g_connection_register_g_object(bus, + dbus_g_connection_register_g_object(priv->bus, INDICATOR_SERVICE_OBJECT, G_OBJECT(self)); -- cgit v1.2.3 From d23ca44c07ddf691ae41b4a6c5c10b794f1de765 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Jul 2010 10:47:58 -0500 Subject: Actually creating a proxy to see if we can detect the watcher going away. --- libindicator/indicator-service.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index d3e873b..01fabce 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -387,9 +387,19 @@ _indicator_service_server_watch (IndicatorService * service, DBusGMethodInvocati const gchar * sender = dbus_g_method_get_sender(method); if (g_hash_table_lookup(priv->watchers, sender) == NULL) { - DBusGProxy * senderproxy = (gpointer)1; - - g_hash_table_insert(priv->watchers, g_strdup(sender), senderproxy); + GError * error = NULL; + DBusGProxy * senderproxy = dbus_g_proxy_new_for_name_owner(priv->bus, + sender, + "/", + DBUS_INTERFACE_INTROSPECTABLE, + &error); + + if (error == NULL) { + g_hash_table_insert(priv->watchers, g_strdup(sender), senderproxy); + } else { + g_warning("Unable to create proxy for watcher '%s': %s", sender, error->message); + g_error_free(error); + } } if (priv->timeout != 0) { -- cgit v1.2.3 From dd7106ee06b70f95879875acccab132a3ef2a8cb Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Jul 2010 11:04:41 -0500 Subject: Creating a callback for the destory signal, but then moving the unwatch into a core function so that we can call it. --- libindicator/indicator-service.c | 42 ++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index 01fabce..15335f3 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -29,6 +29,7 @@ License along with this library. If not, see #include "indicator-service.h" +static void unwatch_core (IndicatorService * service, const gchar * name); /* DBus Prototypes */ static gboolean _indicator_service_server_watch (IndicatorService * service, DBusGMethodInvocation * method); static gboolean _indicator_service_server_un_watch (IndicatorService * service, DBusGMethodInvocation * method); @@ -375,6 +376,19 @@ try_and_get_name (IndicatorService * service) return; } +/* If the proxy gets destroyed that's the same as getting an + unwatch signal. Make it so. */ +static void +proxy_destroyed (GObject * proxy, gpointer user_data) +{ + g_return_if_fail(INDICATOR_IS_SERVICE(user_data)); + + const gchar * name = dbus_g_proxy_get_bus_name(DBUS_G_PROXY(proxy)); + unwatch_core(INDICATOR_SERVICE(user_data), name); + + return; +} + /* Here is the function that gets called by the dbus interface "Watch" function. It is an async function so that we can get the sender and store that information. We @@ -394,6 +408,8 @@ _indicator_service_server_watch (IndicatorService * service, DBusGMethodInvocati DBUS_INTERFACE_INTROSPECTABLE, &error); + g_signal_connect(G_OBJECT(senderproxy), "destroy", G_CALLBACK(proxy_destroyed), service); + if (error == NULL) { g_hash_table_insert(priv->watchers, g_strdup(sender), senderproxy); } else { @@ -413,23 +429,34 @@ _indicator_service_server_watch (IndicatorService * service, DBusGMethodInvocati /* A function connecting into the dbus interface for the "UnWatch" function. It is also an async function to get - the sender. It then looks the sender up and removes them - from the list of watchers. If there are none left, it then - starts the timer for the shutdown signal. */ + the sender and passes everything to unwatch_core to remove it. */ static gboolean _indicator_service_server_un_watch (IndicatorService * service, DBusGMethodInvocation * method) { g_return_val_if_fail(INDICATOR_IS_SERVICE(service), FALSE); + + unwatch_core(service, dbus_g_method_get_sender(method)); + + dbus_g_method_return(method); + return TRUE; +} + +/* Performs the core of loosing a watcher; it removes them + from the list of watchers. If there are none left, it then + starts the timer for the shutdown signal. */ +static void +unwatch_core (IndicatorService * service, const gchar * name) +{ IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(service); /* Remove us from the watcher list here */ - gpointer watcher_item = g_hash_table_lookup(priv->watchers, dbus_g_method_get_sender(method)); + gpointer watcher_item = g_hash_table_lookup(priv->watchers, name); if (watcher_item != NULL) { /* Free the watcher */ - g_hash_table_remove(priv->watchers, dbus_g_method_get_sender(method)); + g_hash_table_remove(priv->watchers, name); } else { /* Odd that we couldn't find the person, but, eh */ - g_warning("Unable to find watcher who is unwatching: %s", dbus_g_method_get_sender(method)); + g_warning("Unable to find watcher who is unwatching: %s", name); } /* If we're out of watchers set the timeout for shutdown */ @@ -445,8 +472,7 @@ _indicator_service_server_un_watch (IndicatorService * service, DBusGMethodInvoc priv->timeout = g_timeout_add(500, timeout_no_watchers, service); } - dbus_g_method_return(method); - return TRUE; + return; } /* API */ -- cgit v1.2.3 From 359c67088ee6eeefc1a7fc28316b94e04ba0feec Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Jul 2010 11:07:22 -0500 Subject: releasing version 0.3.8-2ubuntu1~ppa2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6e1d128..87dd9b1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -libindicator (0.3.8-2ubuntu1~ppa2) UNRELEASED; urgency=low +libindicator (0.3.8-2ubuntu1~ppa2) lucid; urgency=low * Upstream Merge * Make it so that a watcher dying is the same as unregistering. - -- Ted Gould Tue, 06 Jul 2010 11:05:57 -0500 + -- Ted Gould Tue, 06 Jul 2010 11:07:20 -0500 libindicator (0.3.8-2ubuntu1~ppa1) lucid; urgency=low -- cgit v1.2.3 From 2b3087f569dc7f4db6bb94f48cdf902c4d402b6d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Jul 2010 09:25:29 -0500 Subject: releasing version 0.3.8-2ubuntu1~ppa3 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4394823..c4b3ef5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -libindicator (0.3.8-2ubuntu1~ppa3) UNRELEASED; urgency=low +libindicator (0.3.8-2ubuntu1~ppa3) lucid; urgency=low * Merge Upstream * Removing checking for style properties that aren't used. * Make it so that a watcher dying is the same as unregistering. - -- Ted Gould Thu, 08 Jul 2010 09:21:55 -0500 + -- Ted Gould Thu, 08 Jul 2010 09:25:25 -0500 libindicator (0.3.8-2ubuntu1~ppa1) lucid; urgency=low -- cgit v1.2.3 From 46c8b3fee8172b80d0b0ee87887e4b3375c6f659 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Jul 2010 12:23:14 -0500 Subject: Disconnecting signal before removing from hashtable so we don't try twice. --- libindicator/indicator-service.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index 15335f3..c29456e 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -453,6 +453,7 @@ unwatch_core (IndicatorService * service, const gchar * name) gpointer watcher_item = g_hash_table_lookup(priv->watchers, name); if (watcher_item != NULL) { /* Free the watcher */ + g_signal_handlers_disconnect_by_func(G_OBJECT(watcher_item), G_CALLBACK(proxy_destroyed), service); g_hash_table_remove(priv->watchers, name); } else { /* Odd that we couldn't find the person, but, eh */ -- cgit v1.2.3 From 974328f02da5a9c37f3f1e42db5794eb88c5e8ba Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Jul 2010 12:31:56 -0500 Subject: Unreffing the objects in dispose and ensuring we disconnect the signals first. --- libindicator/indicator-service.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index c29456e..a2aea24 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -30,6 +30,8 @@ License along with this library. If not, see #include "indicator-service.h" static void unwatch_core (IndicatorService * service, const gchar * name); +static void proxy_destroyed (GObject * proxy, gpointer user_data); +static gboolean watchers_remove (gpointer key, gpointer value, gpointer user_data); /* DBus Prototypes */ static gboolean _indicator_service_server_watch (IndicatorService * service, DBusGMethodInvocation * method); static gboolean _indicator_service_server_un_watch (IndicatorService * service, DBusGMethodInvocation * method); @@ -209,6 +211,10 @@ indicator_service_dispose (GObject *object) { IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(object); + if (priv->watchers != NULL) { + g_hash_table_foreach_remove(priv->watchers, watchers_remove, object); + } + if (priv->dbus_proxy != NULL) { g_object_unref(G_OBJECT(priv->dbus_proxy)); priv->dbus_proxy = NULL; @@ -314,6 +320,15 @@ get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspe return; } +/* A function to remove the signals on a proxy before we destroy + it because in this case we've stopped caring. */ +static gboolean +watchers_remove (gpointer key, gpointer value, gpointer user_data) +{ + g_signal_handlers_disconnect_by_func(G_OBJECT(value), G_CALLBACK(proxy_destroyed), user_data); + return TRUE; +} + /* This is the function that gets executed if we timeout because there are no watchers. We sent the shutdown signal and hope someone does something sane with it. */ -- cgit v1.2.3 From 647f8ea91cc304a0b14a255fcd07560046735eac Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Jul 2010 12:34:24 -0500 Subject: Use the same function so we know everything is all right. --- libindicator/indicator-service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index a2aea24..7c5826e 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -468,7 +468,7 @@ unwatch_core (IndicatorService * service, const gchar * name) gpointer watcher_item = g_hash_table_lookup(priv->watchers, name); if (watcher_item != NULL) { /* Free the watcher */ - g_signal_handlers_disconnect_by_func(G_OBJECT(watcher_item), G_CALLBACK(proxy_destroyed), service); + watchers_remove((gpointer)name, watcher_item, service); g_hash_table_remove(priv->watchers, name); } else { /* Odd that we couldn't find the person, but, eh */ -- cgit v1.2.3 From 7412490502f6f249479c1f4d7e07ab868530dcd0 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Jul 2010 12:36:50 -0500 Subject: Documenting the choices of not having a nice callback func. --- libindicator/indicator-service.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index 7c5826e..db234e2 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -165,6 +165,10 @@ indicator_service_init (IndicatorService *self) priv->bus = NULL; priv->this_service_version = 0; + /* NOTE: We're using g_object_unref here because that's what needs to + happen, but you really should call watchers_remove first as well + since that disconnects the signals. We can't do that with a callback + here because there is no user data to pass the object as well. */ priv->watchers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref); /* Start talkin' dbus */ -- cgit v1.2.3 From bc5e925ed181f2b64229afcac41bb4ba4f9aa4d1 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Jul 2010 15:12:12 -0500 Subject: 0.3.9 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 8ae0c74..2622d73 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ -AC_INIT(libindicator, 0.3.8, ted@canonical.com) +AC_INIT(libindicator, 0.3.9, ted@canonical.com) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libindicator, 0.3.8) +AM_INIT_AUTOMAKE(libindicator, 0.3.9) AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES]) -- cgit v1.2.3 From 3fc3179d758ccef92bbc8e33d4ae20b5ab79a8b7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Jul 2010 15:19:11 -0500 Subject: releasing version 0.3.9-0ubuntu1~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5cc8b50..e9f1326 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -libindicator (0.3.9-0ubuntu1~ppa1) UNRELEASED; urgency=low +libindicator (0.3.9-0ubuntu1~ppa1) lucid; urgency=low * New upstream release. * Removing checking for style properties that aren't used. @@ -8,7 +8,7 @@ libindicator (0.3.9-0ubuntu1~ppa1) UNRELEASED; urgency=low * debian/control: Switch VCS for this branch to be the indicator applet developers branch. - -- Ted Gould Thu, 08 Jul 2010 15:17:32 -0500 + -- Ted Gould Thu, 08 Jul 2010 15:19:08 -0500 libindicator (0.3.8-2) unstable; urgency=low -- cgit v1.2.3