diff pidgin/gtkstatusbox.c @ 30909:25e200cb3532

propagate from branch 'im.pidgin.pidgin' (head dca20e09164518b0f7a773edd7e9649f41d8873d) to branch 'im.pidgin.cpw.malu.xmpp.google_refactor' (head 7823c556f2d1bbca43f5ef9f0fea30cabc5d313f)
author Marcus Lundblad <ml@update.uu.se>
date Tue, 31 Aug 2010 18:28:10 +0000
parents c9a57878ed17
children 5841cbbebc53 917c597beb97
line wrap: on
line diff
--- a/pidgin/gtkstatusbox.c	Fri Apr 09 22:14:51 2010 +0000
+++ b/pidgin/gtkstatusbox.c	Tue Aug 31 18:28:10 2010 +0000
@@ -657,7 +657,6 @@
 static void
 pidgin_status_box_refresh(PidginStatusBox *status_box)
 {
-	GtkIconSize icon_size;
 	GtkStyle *style;
 	char aa_color[8];
 	PurpleSavedStatus *saved_status;
@@ -668,8 +667,6 @@
 	gboolean account_status = FALSE;
 	PurpleAccount *acct = (status_box->account) ? status_box->account : status_box->token_status_account;
 
-	icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL);
-
 	style = gtk_widget_get_style(GTK_WIDGET(status_box));
 	snprintf(aa_color, sizeof(aa_color), "#%02x%02x%02x",
 		 style->text_aa[GTK_STATE_NORMAL].red >> 8,
@@ -969,11 +966,7 @@
 		PurpleSavedStatus *saved = cur->data;
 		const gchar *message;
 		gchar *stripped = NULL;
-		PurpleStatusPrimitive prim;
-		PidginStatusBoxItemType type = PIDGIN_STATUS_BOX_TYPE_POPULAR;
-
-		/* Get an appropriate status icon */
-		prim = purple_savedstatus_get_type(saved);
+		PidginStatusBoxItemType type;
 
 		if (purple_savedstatus_is_transient(saved))
 		{
@@ -982,16 +975,18 @@
 			 * API returns the message when purple_savedstatus_get_title() is
 			 * called, so we don't need to get the message a second time.
 			 */
+			type = PIDGIN_STATUS_BOX_TYPE_POPULAR;
 		}
 		else
 		{
+			type = PIDGIN_STATUS_BOX_TYPE_SAVED_POPULAR;
+
 			message = purple_savedstatus_get_message(saved);
 			if (message != NULL)
 			{
 				stripped = purple_markup_strip_html(message);
 				purple_util_chrreplace(stripped, '\n', ' ');
 			}
-			type = PIDGIN_STATUS_BOX_TYPE_SAVED_POPULAR;
 		}
 
 		pidgin_status_box_add(statusbox, type,
@@ -1074,17 +1069,13 @@
 					PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, NULL,
 					purple_status_type_get_name(status_type),
 					NULL,
-					GINT_TO_POINTER(purple_status_type_get_primitive(status_type)));
+					GINT_TO_POINTER(prim));
 	}
 }
 
 static void
 pidgin_status_box_regenerate(PidginStatusBox *status_box, gboolean status_changed)
 {
-	GtkIconSize icon_size;
-
-	icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL);
-
 	/* Unset the model while clearing it */
 	gtk_tree_view_set_model(GTK_TREE_VIEW(status_box->tree_view), NULL);
 	gtk_list_store_clear(status_box->dropdown_store);