changeset 5161:777f56b95a92

[gaim-migrate @ 5525] Less evil still. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 18 Apr 2003 03:26:42 +0000
parents 91ea5ef2278b
children b8eafeb874a1
files src/away.c src/gtkpounce.c src/prpl.c
diffstat 3 files changed, 25 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/away.c	Fri Apr 18 02:28:06 2003 +0000
+++ b/src/away.c	Fri Apr 18 03:26:42 2003 +0000
@@ -489,21 +489,21 @@
 					continue;
 				}
 
+				g_snprintf(buf, sizeof(buf), "%s (%s)",
+					   gc->username, gc->prpl->name);
+				menuitem = gtk_image_menu_item_new_with_label(buf);
+
 				pixbuf = create_prpl_icon(gc->account);
 				if (pixbuf) {
 					scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, GDK_INTERP_BILINEAR);
 					image = gtk_image_new_from_pixbuf(scale);
 					g_object_unref(G_OBJECT(pixbuf));
 					g_object_unref(G_OBJECT(scale));
-				} else {
-					image = gtk_image_new();
+					gtk_widget_show(image);
+					gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem),
+							image);
 				}
-				gtk_widget_show(image);
 
-				g_snprintf(buf, sizeof(buf), "%s (%s)",
-					   gc->username, gc->prpl->name);
-				menuitem = gtk_image_menu_item_new_with_label(buf);
-				gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
 				gtk_menu_shell_append(GTK_MENU_SHELL(awaymenu), menuitem);
 				gtk_widget_show(menuitem);
 
--- a/src/gtkpounce.c	Fri Apr 18 02:28:06 2003 +0000
+++ b/src/gtkpounce.c	Fri Apr 18 03:26:42 2003 +0000
@@ -737,22 +737,24 @@
 		pounce = (struct gaim_pounce *)bp->data;
 		buddy = gaim_pounce_get_pouncee(pounce);
 
+		/* Build the menu item */
+		item = gtk_image_menu_item_new_with_label(buddy);
+
 		/* Create a pixmap for the protocol icon. */
 		pixbuf = create_prpl_icon(gaim_pounce_get_pouncer(pounce));
-		scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, GDK_INTERP_BILINEAR);
+		if(pixbuf) {
+			scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16,
+					GDK_INTERP_BILINEAR);
 
-		/* Now convert it to GtkImage */
-		if (pixbuf == NULL)
-			image = gtk_image_new();
-		else
+			/* Now convert it to GtkImage */
 			image = gtk_image_new_from_pixbuf(scale);
-
-		g_object_unref(G_OBJECT(scale));
-		g_object_unref(G_OBJECT(pixbuf));
+			g_object_unref(G_OBJECT(scale));
+			g_object_unref(G_OBJECT(pixbuf));
+			gtk_widget_show(image);
+			gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
+		}
 
-		/* Build the menu item */
-		item = gtk_image_menu_item_new_with_label(buddy);
-		gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
+		/* Put the item in the menu */
 		gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
 		gtk_widget_show(item);
 
--- a/src/prpl.c	Fri Apr 18 02:28:06 2003 +0000
+++ b/src/prpl.c	Fri Apr 18 03:26:42 2003 +0000
@@ -408,6 +408,9 @@
 				continue;
 			}
 
+			g_snprintf(buf, sizeof(buf), "%s (%s)", gc->username, gc->prpl->name);
+			menuitem = gtk_image_menu_item_new_with_label(buf);
+
 			pixbuf = create_prpl_icon(gc->account);
 			if(pixbuf) {
 				scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16,
@@ -415,15 +418,10 @@
 				image = gtk_image_new_from_pixbuf(scale);
 				g_object_unref(G_OBJECT(pixbuf));
 				g_object_unref(G_OBJECT(scale));
-			} else {
-				image = gtk_image_new();
+				gtk_widget_show(image);
+				gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
 			}
 
-			gtk_widget_show(image);
-
-			g_snprintf(buf, sizeof(buf), "%s (%s)", gc->username, gc->prpl->name);
-			menuitem = gtk_image_menu_item_new_with_label(buf);
-			gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
 			gtk_menu_shell_append(GTK_MENU_SHELL(protomenu), menuitem);
 			gtk_widget_show(menuitem);