Mercurial > pidgin.yaz
comparison pidgin/gtkstatusbox.c @ 30863:351d07aefb09
Kill off many dead assignments and any useless remaining variables.
I think some of those QQ ones were actual logic errors, too.
Let me know if there were any side-effects that were cut.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Mon, 23 Aug 2010 00:52:24 +0000 |
parents | 020f46d39cf7 |
children | c9a57878ed17 |
comparison
equal
deleted
inserted
replaced
30862:922c8c553758 | 30863:351d07aefb09 |
---|---|
655 * should modify status_box->store | 655 * should modify status_box->store |
656 */ | 656 */ |
657 static void | 657 static void |
658 pidgin_status_box_refresh(PidginStatusBox *status_box) | 658 pidgin_status_box_refresh(PidginStatusBox *status_box) |
659 { | 659 { |
660 GtkIconSize icon_size; | |
661 GtkStyle *style; | 660 GtkStyle *style; |
662 char aa_color[8]; | 661 char aa_color[8]; |
663 PurpleSavedStatus *saved_status; | 662 PurpleSavedStatus *saved_status; |
664 char *primary, *secondary, *text; | 663 char *primary, *secondary, *text; |
665 const char *stock = NULL; | 664 const char *stock = NULL; |
666 GdkPixbuf *emblem = NULL; | 665 GdkPixbuf *emblem = NULL; |
667 GtkTreePath *path; | 666 GtkTreePath *path; |
668 gboolean account_status = FALSE; | 667 gboolean account_status = FALSE; |
669 PurpleAccount *acct = (status_box->account) ? status_box->account : status_box->token_status_account; | 668 PurpleAccount *acct = (status_box->account) ? status_box->account : status_box->token_status_account; |
670 | |
671 icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL); | |
672 | 669 |
673 style = gtk_widget_get_style(GTK_WIDGET(status_box)); | 670 style = gtk_widget_get_style(GTK_WIDGET(status_box)); |
674 snprintf(aa_color, sizeof(aa_color), "#%02x%02x%02x", | 671 snprintf(aa_color, sizeof(aa_color), "#%02x%02x%02x", |
675 style->text_aa[GTK_STATE_NORMAL].red >> 8, | 672 style->text_aa[GTK_STATE_NORMAL].red >> 8, |
676 style->text_aa[GTK_STATE_NORMAL].green >> 8, | 673 style->text_aa[GTK_STATE_NORMAL].green >> 8, |
967 for (cur = list; cur != NULL; cur = cur->next) | 964 for (cur = list; cur != NULL; cur = cur->next) |
968 { | 965 { |
969 PurpleSavedStatus *saved = cur->data; | 966 PurpleSavedStatus *saved = cur->data; |
970 const gchar *message; | 967 const gchar *message; |
971 gchar *stripped = NULL; | 968 gchar *stripped = NULL; |
972 PurpleStatusPrimitive prim; | |
973 PidginStatusBoxItemType type = PIDGIN_STATUS_BOX_TYPE_POPULAR; | 969 PidginStatusBoxItemType type = PIDGIN_STATUS_BOX_TYPE_POPULAR; |
974 | |
975 /* Get an appropriate status icon */ | |
976 prim = purple_savedstatus_get_type(saved); | |
977 | 970 |
978 if (purple_savedstatus_is_transient(saved)) | 971 if (purple_savedstatus_is_transient(saved)) |
979 { | 972 { |
980 /* | 973 /* |
981 * Transient statuses do not have a title, so the savedstatus | 974 * Transient statuses do not have a title, so the savedstatus |
1072 | 1065 |
1073 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), | 1066 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), |
1074 PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, NULL, | 1067 PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, NULL, |
1075 purple_status_type_get_name(status_type), | 1068 purple_status_type_get_name(status_type), |
1076 NULL, | 1069 NULL, |
1077 GINT_TO_POINTER(purple_status_type_get_primitive(status_type))); | 1070 GINT_TO_POINTER(prim)); |
1078 } | 1071 } |
1079 } | 1072 } |
1080 | 1073 |
1081 static void | 1074 static void |
1082 pidgin_status_box_regenerate(PidginStatusBox *status_box, gboolean status_changed) | 1075 pidgin_status_box_regenerate(PidginStatusBox *status_box, gboolean status_changed) |
1083 { | 1076 { |
1084 GtkIconSize icon_size; | |
1085 | |
1086 icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL); | |
1087 | |
1088 /* Unset the model while clearing it */ | 1077 /* Unset the model while clearing it */ |
1089 gtk_tree_view_set_model(GTK_TREE_VIEW(status_box->tree_view), NULL); | 1078 gtk_tree_view_set_model(GTK_TREE_VIEW(status_box->tree_view), NULL); |
1090 gtk_list_store_clear(status_box->dropdown_store); | 1079 gtk_list_store_clear(status_box->dropdown_store); |
1091 /* Don't set the model until the new statuses have been added to the box. | 1080 /* Don't set the model until the new statuses have been added to the box. |
1092 * What is presumably a bug in Gtk < 2.4 causes things to get all confused | 1081 * What is presumably a bug in Gtk < 2.4 causes things to get all confused |