Ted Gould has proposed merging 
lp:~indicator-applet-developers/indicator-applet/messages-packaging into 
lp:~ubuntu-core-dev/indicator-applet/messages-ubuntu.

Requested reviews:
    Ubuntu Sponsors for main (ubuntu-main-sponsors)
-- 
https://code.launchpad.net/~indicator-applet-developers/indicator-applet/messages-packaging/+merge/5331
Your team Indicator Applet Developers is subscribed to branch 
lp:~indicator-applet-developers/indicator-applet/messages-packaging.
=== modified file 'configure.ac'
--- configure.ac	2009-03-28 04:52:04 +0000
+++ configure.ac	2009-04-08 03:09:41 +0000
@@ -4,7 +4,7 @@
 AC_PREREQ(2.53)
 
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(indicator-messages, 0.1.4)
+AM_INIT_AUTOMAKE(indicator-messages, 0.1.5)
 
 AM_MAINTAINER_MODE
 
@@ -24,7 +24,7 @@
 GTK_REQUIRED_VERSION=2.12
 GIO_UNIX_REQUIRED_VERSION=2.18
 PANEL_REQUIRED_VERSION=2.0.0
-INDICATE_REQUIRED_VERSION=0.1
+INDICATE_REQUIRED_VERSION=0.1.5
 
 PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
                           gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION

=== modified file 'debian/changelog'
--- debian/changelog	2009-03-30 07:40:46 +0000
+++ debian/changelog	2009-04-08 03:58:16 +0000
@@ -1,3 +1,15 @@
+indicator-messages (0.1.5-0ubuntu1) UNRELEASED; urgency=low
+
+  * New upstream version
+    * Fixes the lifecycle of the various structures tracking the messages
+      and applications.  Fixing bugs like (LP: #355616) (LP: #352881)
+    * Fixes the visual appearance by setting the widget name to grab the
+      style settings from the main applet.  (LP: #351979)
+  * debian/control: Upgrading dependency on libindicate-dev to 0.1.5 or
+    higher as the new version requires that.
+
+ -- Ted Gould <[email protected]>  Fri, 03 Apr 2009 16:32:49 -0500
+
 indicator-messages (0.1.4-0ubuntu1) jaunty; urgency=low
 
   * New upstream version

=== modified file 'debian/control'
--- debian/control	2009-02-17 10:25:14 +0000
+++ debian/control	2009-04-08 03:00:24 +0000
@@ -9,7 +9,7 @@
                gnome-doc-utils,
                scrollkeeper,
                intltool,
-               libindicate-dev
+               libindicate-dev (>= 0.1.5)
 Standards-Version: 3.8.0
 Homepage: https://launchpad.net/indicator-applet
 Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/indicator-applet/messages-ubuntu

=== modified file 'src/app-menu-item.c'
--- src/app-menu-item.c	2009-03-18 19:22:08 +0000
+++ src/app-menu-item.c	2009-04-03 20:25:52 +0000
@@ -160,6 +160,9 @@
 
 	g_signal_connect(G_OBJECT(self), "activate", G_CALLBACK(activate_cb), NULL);
 
+	indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_SERVER_DISPLAY);
+	indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_SERVER_SIGNAL);
+
 	return self;
 }
 
@@ -179,6 +182,11 @@
 		/* For IM and Microblogging we want the individual items, not a count */
 		priv->count_on_label = TRUE;
 		update_label(self);
+
+		indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_INDICATOR_COUNT);
+	} else {
+		indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_INDICATOR_DISPLAY);
+		indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_INDICATOR_SIGNAL);
 	}
 
 	return;

=== modified file 'src/im-menu-item.c'
--- src/im-menu-item.c	2009-03-27 15:53:04 +0000
+++ src/im-menu-item.c	2009-04-07 22:00:29 +0000
@@ -44,6 +44,7 @@
 
 	glong seconds;
 	gboolean show_time;
+	gulong indicator_changed;
 
 	guint time_update_min;
 
@@ -171,6 +172,11 @@
 	if (priv->time_update_min != 0) {
 		g_source_remove(priv->time_update_min);
 	}
+
+	g_signal_handler_disconnect(priv->listener, priv->indicator_changed);
+	priv->indicator_changed = 0;
+
+	return;
 }
 
 static void
@@ -265,7 +271,7 @@
 		return;
 	}
 
-	if (property == NULL || strcmp(property, "time")) {
+	if (property == NULL || g_strcmp0(property, "time")) {
 		g_warning("Time callback called without being sent the time.");
 		return;
 	}
@@ -295,7 +301,7 @@
 		return;
 	}
 
-	if (property == NULL || strcmp(property, "sender")) {
+	if (property == NULL || g_strcmp0(property, "sender")) {
 		g_warning("Sender callback called without being sent the sender.  We got '%s' with value '%s'.", property, propertydata);
 		return;
 	}
@@ -326,13 +332,13 @@
 
 	/* Not meant for us */
 	if (INDICATE_LISTENER_INDICATOR_ID(indicator) != INDICATE_LISTENER_INDICATOR_ID(priv->indicator)) return;
-	if (strcmp(INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_SERVER_DBUS_NAME(priv->server))) return;
+	if (server != priv->server) return;
 
-	if (!strcmp(property, "sender")) {
+	if (!g_strcmp0(property, "sender")) {
 		indicate_listener_get_property(listener, server, indicator, "sender", sender_cb, self);	
-	} else if (!strcmp(property, "time")) {
+	} else if (!g_strcmp0(property, "time")) {
 		indicate_listener_get_property_time(listener, server, indicator, "time",   time_cb, self);	
-	} else if (!strcmp(property, "icon")) {
+	} else if (!g_strcmp0(property, "icon")) {
 		indicate_listener_get_property_icon(listener, server, indicator, "icon",   icon_cb, self);	
 	}
 	
@@ -358,7 +364,7 @@
 	indicate_listener_get_property_icon(listener, server, indicator, "icon",   icon_cb, self);	
 
 	g_signal_connect(G_OBJECT(self), "activate", G_CALLBACK(activate_cb), NULL);
-	g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_INDICATOR_MODIFIED, G_CALLBACK(indicator_modified_cb), self);
+	priv->indicator_changed = g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_INDICATOR_MODIFIED, G_CALLBACK(indicator_modified_cb), self);
 
 	return self;
 }

=== modified file 'src/indicator-messages.c'
--- src/indicator-messages.c	2009-03-27 15:48:54 +0000
+++ src/indicator-messages.c	2009-04-08 02:50:41 +0000
@@ -36,6 +36,7 @@
 static void server_name_changed (AppMenuItem * appitem, gchar * name, gpointer data);
 static void im_time_changed (ImMenuItem * imitem, glong seconds, gpointer data);
 static void reconsile_list_and_menu (GList * serverlist, GtkMenuShell * menushell);
+static void indicator_removed (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type, gpointer data);
 
 #define DESIGN_TEAM_SIZE  design_team_size
 static GtkIconSize design_team_size;
@@ -55,8 +56,8 @@
 	pa = (serverList_t *)a;
 	pb = (serverList_t *)b;
 
-	gchar * pas = INDICATE_LISTENER_SERVER_DBUS_NAME(pa->server);
-	gchar * pbs = INDICATE_LISTENER_SERVER_DBUS_NAME(pb->server);
+	const gchar * pas = INDICATE_LISTENER_SERVER_DBUS_NAME(pa->server);
+	const gchar * pbs = INDICATE_LISTENER_SERVER_DBUS_NAME(pb->server);
 
 	return g_strcmp0(pas, pbs);
 }
@@ -80,6 +81,7 @@
 	IndicateListenerServer * server;
 	IndicateListenerIndicator * indicator;
 	GtkWidget * menuitem;
+	gulong timechange_cb;
 };
 
 static gboolean
@@ -90,15 +92,15 @@
 	pa = (imList_t *)a;
 	pb = (imList_t *)b;
 
-	gchar * pas = INDICATE_LISTENER_SERVER_DBUS_NAME(pa->server);
-	gchar * pbs = INDICATE_LISTENER_SERVER_DBUS_NAME(pb->server);
+	const gchar * pas = INDICATE_LISTENER_SERVER_DBUS_NAME(pa->server);
+	const gchar * pbs = INDICATE_LISTENER_SERVER_DBUS_NAME(pb->server);
 
 	guint pai = INDICATE_LISTENER_INDICATOR_ID(pa->indicator);
 	guint pbi = INDICATE_LISTENER_INDICATOR_ID(pb->indicator);
 
 	g_debug("\tComparing (%s %d) to (%s %d)", pas, pai, pbs, pbi);
 
-	return !((!strcmp(pas, pbs)) && (pai == pbi));
+	return !((!g_strcmp0(pas, pbs)) && (pai == pbi));
 }
 
 static gint
@@ -139,7 +141,7 @@
 	g_signal_connect(G_OBJECT(menuitem), APP_MENU_ITEM_SIGNAL_COUNT_CHANGED, G_CALLBACK(server_count_changed), NULL);
 	g_signal_connect(G_OBJECT(menuitem), APP_MENU_ITEM_SIGNAL_NAME_CHANGED,  G_CALLBACK(server_name_changed),  menushell);
 
-	serverList_t * sl_item = g_new(serverList_t, 1);
+	serverList_t * sl_item = g_new0(serverList_t, 1);
 	sl_item->server = server;
 	sl_item->menuitem = menuitem;
 	sl_item->imList = NULL;
@@ -241,6 +243,12 @@
 	}
 
 	serverList_t * sltp = (serverList_t *)lookup->data;
+
+	while (sltp->imList) {
+		imList_t * imitem = (imList_t *)sltp->imList->data;
+		indicator_removed(listener, server, imitem->indicator, "message", data);
+	}
+
 	serverList = g_list_remove(serverList, sltp);
 
 	if (sltp->menuitem != NULL) {
@@ -280,7 +288,7 @@
 	}
 
 	AppMenuItem * appmenu = APP_MENU_ITEM(data_mi);
-	if (!g_strcmp0(INDICATE_LISTENER_SERVER_DBUS_NAME(msl->server), INDICATE_LISTENER_SERVER_DBUS_NAME(app_menu_item_get_server(appmenu)))) {
+	if (!g_strcmp0(INDICATE_LISTENER_SERVER_DBUS_NAME((IndicateListenerServer*)msl->server), INDICATE_LISTENER_SERVER_DBUS_NAME(app_menu_item_get_server(appmenu)))) {
 		msl->found = TRUE;
 	}
 
@@ -327,7 +335,7 @@
 		return;
 	}
 
-	if (property == NULL || strcmp(property, "subtype")) {
+	if (property == NULL || g_strcmp0(property, "subtype")) {
 		/* We should only ever get subtypes, but just in case */
 		g_warning("Subtype callback got a property '%s'", property);
 		return;
@@ -342,13 +350,13 @@
 
 	g_debug("Message subtype: %s", propertydata);
 
-	if (!strcmp(propertydata, "im") || !strcmp(propertydata, "login")) {
-		imList_t * listItem = g_new(imList_t, 1);
+	if (!g_strcmp0(propertydata, "im") || !g_strcmp0(propertydata, "login")) {
+		imList_t * listItem = g_new0(imList_t, 1);
 		listItem->server = server;
 		listItem->indicator = indicator;
 
 		g_debug("Building IM Item");
-		ImMenuItem * menuitem = im_menu_item_new(listener, server, indicator, !strcmp(propertydata, "im"));
+		ImMenuItem * menuitem = im_menu_item_new(listener, server, indicator, !g_strcmp0(propertydata, "im"));
 		g_object_ref(G_OBJECT(menuitem));
 		listItem->menuitem = GTK_WIDGET(menuitem);
 
@@ -361,7 +369,7 @@
 		if (serverentry == NULL) {
 			/* This sucks, we got an indicator before the server.  I guess
 			   that's the joy of being asynchronous */
-			serverList_t * sl_item = g_new(serverList_t, 1);
+			serverList_t * sl_item = g_new0(serverList_t, 1);
 			sl_item->server = server;
 			sl_item->menuitem = NULL;
 			sl_item->imList = NULL;
@@ -373,7 +381,7 @@
 
 		g_debug("Adding to IM List");
 		sl_item->imList = g_list_insert_sorted(sl_item->imList, listItem, imList_sort);
-		g_signal_connect(G_OBJECT(menuitem), IM_MENU_ITEM_SIGNAL_TIME_CHANGED, G_CALLBACK(im_time_changed), sl_item);
+		listItem->timechange_cb = g_signal_connect(G_OBJECT(menuitem), IM_MENU_ITEM_SIGNAL_TIME_CHANGED, G_CALLBACK(im_time_changed), sl_item);
 
 		g_debug("Placing in Shell");
 		menushell_location_t msl;
@@ -396,7 +404,7 @@
 static void
 indicator_added (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type, gpointer data)
 {
-	if (type == NULL || strcmp(type, "message")) {
+	if (type == NULL || g_strcmp0(type, "message")) {
 		/* We only care about message type indicators
 		   all of the others can go to the bit bucket */
 		g_debug("Ignoreing indicator of type '%s'", type);
@@ -411,8 +419,8 @@
 static void
 indicator_removed (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type, gpointer data)
 {
-	g_debug("Removing %s %d", (gchar*)server, (guint)indicator);
-	if (type == NULL || strcmp(type, "message")) {
+	g_debug("Removing %s %d", INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_INDICATOR_ID(indicator));
+	if (type == NULL || g_strcmp0(type, "message")) {
 		/* We only care about message type indicators
 		   all of the others can go to the bit bucket */
 		g_debug("Ignoreing indicator of type '%s'", type);
@@ -437,23 +445,24 @@
 
 	GList * listItem = g_list_find_custom(sl_item->imList, &listData, imList_equal);
 	GtkWidget * menuitem = NULL;
+	imList_t * ilt = NULL;
 	if (listItem != NULL) {
-		menuitem = ((imList_t *)listItem->data)->menuitem;
+		ilt = (imList_t *)listItem->data;
+		menuitem = ilt->menuitem;
 	}
 
 	if (!removed && menuitem != NULL) {
-		g_object_ref(menuitem);
-		sl_item->imList = g_list_remove(sl_item->imList, listItem->data);
+		sl_item->imList = g_list_remove(sl_item->imList, ilt);
+		g_signal_handler_disconnect(menuitem, ilt->timechange_cb);
+		g_free(ilt);
 
 		gtk_widget_hide(menuitem);
 		gtk_container_remove(GTK_CONTAINER(data), menuitem);
-
-		g_object_unref(menuitem);
 		removed = TRUE;
 	}
 
 	if (!removed) {
-		g_warning("We were asked to remove %s %d but we didn't.", (gchar*)server, (guint)indicator);
+		g_warning("We were asked to remove %s %d but we didn't.", INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_INDICATOR_ID(indicator));
 	}
 
 	return;
@@ -468,6 +477,7 @@
 	serverList = NULL;
 
 	main_menu = gtk_menu_item_new();
+	gtk_widget_set_name(main_menu, "fast-user-switch-menuitem");
 
 	main_image = gtk_image_new_from_icon_name("indicator-messages", DESIGN_TEAM_SIZE);
 	gtk_widget_show(main_image);

_______________________________________________
Mailing list: https://launchpad.net/~dx-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~dx-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to