comparison pidgin/gtkblist.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 7c871249318b
children 1e684071fbeb
comparison
equal deleted inserted replaced
30862:922c8c553758 30863:351d07aefb09
3963 purple_notify_user_info_add_pair(user_info, 3963 purple_notify_user_info_add_pair(user_info,
3964 _("Online Buddies"), 3964 _("Online Buddies"),
3965 tmp); 3965 tmp);
3966 g_free(tmp); 3966 g_free(tmp);
3967 } 3967 }
3968 count = 0;
3969 3968
3970 count = purple_blist_get_group_size(group, FALSE); 3969 count = purple_blist_get_group_size(group, FALSE);
3971 if (count != 0) { 3970 if (count != 0) {
3972 /* Total buddies (from online accounts) in group */ 3971 /* Total buddies (from online accounts) in group */
3973 tmp = g_strdup_printf("%d", count); 3972 tmp = g_strdup_printf("%d", count);
3974 purple_notify_user_info_add_pair(user_info, 3973 purple_notify_user_info_add_pair(user_info,
3975 _("Total Buddies"), 3974 _("Total Buddies"),
3976 tmp); 3975 tmp);
3977 g_free(tmp); 3976 g_free(tmp);
3978 } 3977 }
3979 count = 0;
3980 3978
3981 tmp = purple_notify_user_info_get_text_with_newline(user_info, "\n"); 3979 tmp = purple_notify_user_info_get_text_with_newline(user_info, "\n");
3982 g_string_append(str, tmp); 3980 g_string_append(str, tmp);
3983 g_free(tmp); 3981 g_free(tmp);
3984 3982
4021 GdkPixbuf * 4019 GdkPixbuf *
4022 pidgin_blist_get_emblem(PurpleBlistNode *node) 4020 pidgin_blist_get_emblem(PurpleBlistNode *node)
4023 { 4021 {
4024 PurpleBuddy *buddy = NULL; 4022 PurpleBuddy *buddy = NULL;
4025 struct _pidgin_blist_node *gtknode = node->ui_data; 4023 struct _pidgin_blist_node *gtknode = node->ui_data;
4026 struct _pidgin_blist_node *gtkbuddynode = NULL;
4027 PurplePlugin *prpl; 4024 PurplePlugin *prpl;
4028 PurplePluginProtocolInfo *prpl_info; 4025 PurplePluginProtocolInfo *prpl_info;
4029 const char *name = NULL; 4026 const char *name = NULL;
4030 char *filename, *path; 4027 char *filename, *path;
4031 PurplePresence *p = NULL; 4028 PurplePresence *p = NULL;
4032 PurpleStatus *tune; 4029 PurpleStatus *tune;
4033 4030
4034 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { 4031 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) {
4035 if(!gtknode->contact_expanded) { 4032 if(!gtknode->contact_expanded) {
4036 buddy = purple_contact_get_priority_buddy((PurpleContact*)node); 4033 buddy = purple_contact_get_priority_buddy((PurpleContact*)node);
4037 gtkbuddynode = ((PurpleBlistNode*)buddy)->ui_data;
4038 } 4034 }
4039 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { 4035 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) {
4040 buddy = (PurpleBuddy*)node; 4036 buddy = (PurpleBuddy*)node;
4041 gtkbuddynode = node->ui_data;
4042 p = purple_buddy_get_presence(buddy); 4037 p = purple_buddy_get_presence(buddy);
4043 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) { 4038 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) {
4044 /* This emblem comes from the small emoticon set now, 4039 /* This emblem comes from the small emoticon set now,
4045 * to reduce duplication. */ 4040 * to reduce duplication. */
4046 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", 4041 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes",
4129 4124
4130 GdkPixbuf * 4125 GdkPixbuf *
4131 pidgin_blist_get_status_icon(PurpleBlistNode *node, PidginStatusIconSize size) 4126 pidgin_blist_get_status_icon(PurpleBlistNode *node, PidginStatusIconSize size)
4132 { 4127 {
4133 GdkPixbuf *ret; 4128 GdkPixbuf *ret;
4134 const char *protoname = NULL;
4135 const char *icon = NULL; 4129 const char *icon = NULL;
4136 struct _pidgin_blist_node *gtknode = node->ui_data; 4130 struct _pidgin_blist_node *gtknode = node->ui_data;
4137 struct _pidgin_blist_node *gtkbuddynode = NULL; 4131 struct _pidgin_blist_node *gtkbuddynode = NULL;
4138 PurpleBuddy *buddy = NULL; 4132 PurpleBuddy *buddy = NULL;
4139 PurpleChat *chat = NULL; 4133 PurpleChat *chat = NULL;
4156 } 4150 }
4157 4151
4158 if(buddy || chat) { 4152 if(buddy || chat) {
4159 PurpleAccount *account; 4153 PurpleAccount *account;
4160 PurplePlugin *prpl; 4154 PurplePlugin *prpl;
4161 PurplePluginProtocolInfo *prpl_info;
4162 4155
4163 if(buddy) 4156 if(buddy)
4164 account = buddy->account; 4157 account = buddy->account;
4165 else 4158 else
4166 account = chat->account; 4159 account = chat->account;
4167 4160
4168 prpl = purple_find_prpl(purple_account_get_protocol_id(account)); 4161 prpl = purple_find_prpl(purple_account_get_protocol_id(account));
4169 if(!prpl) 4162 if(!prpl)
4170 return NULL; 4163 return NULL;
4171
4172 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
4173
4174 if(prpl_info && prpl_info->list_icon) {
4175 protoname = prpl_info->list_icon(account, buddy);
4176 }
4177 } 4164 }
4178 4165
4179 if(buddy) { 4166 if(buddy) {
4180 PurpleConversation *conv = find_conversation_with_buddy(buddy); 4167 PurpleConversation *conv = find_conversation_with_buddy(buddy);
4181 PurplePresence *p; 4168 PurplePresence *p;