console/gntblist.c

changeset 14910
a51aca2259d0
parent 14909
d72792eb7575
child 14912
176bce6dc803
equal deleted inserted replaced
14909:d72792eb7575 14910:a51aca2259d0
156 gnt_widget_destroy(ggblist->tooltip); 156 gnt_widget_destroy(ggblist->tooltip);
157 ggblist->tooltip = NULL; 157 ggblist->tooltip = NULL;
158 ggblist->tnode = NULL; 158 ggblist->tnode = NULL;
159 } 159 }
160 160
161 static gboolean
162 _draw_tooltip(gpointer data)
163 {
164 draw_tooltip(data);
165 return FALSE;
166 }
167
161 static void 168 static void
162 node_remove(GaimBuddyList *list, GaimBlistNode *node) 169 node_remove(GaimBuddyList *list, GaimBlistNode *node)
163 { 170 {
164 GGBlist *ggblist = list->ui_data; 171 GGBlist *ggblist = list->ui_data;
165 172
178 GaimGroup *group = (GaimGroup*)node->parent; 185 GaimGroup *group = (GaimGroup*)node->parent;
179 if ((!gaim_prefs_get_bool(PREF_ROOT "/showoffline") && !is_group_online(group)) || 186 if ((!gaim_prefs_get_bool(PREF_ROOT "/showoffline") && !is_group_online(group)) ||
180 group->currentsize < 1) 187 group->currentsize < 1)
181 node_remove(list, node->parent); 188 node_remove(list, node->parent);
182 } 189 }
183 draw_tooltip(ggblist); 190
191 /* When an account has signed off, it removes one buddy at a time.
192 * Drawing the tooltip after removing each buddy is expensive. On
193 * top of that, if the selected buddy belongs to the disconnected
194 * account, then retreiving the tooltip for that causes crash. So
195 * let's make sure we wait for all the buddies to be removed first.*/
196 g_timeout_add(0, _draw_tooltip, ggblist);
184 } 197 }
185 198
186 static void 199 static void
187 node_update(GaimBuddyList *list, GaimBlistNode *node) 200 node_update(GaimBuddyList *list, GaimBlistNode *node)
188 { 201 {
1448 1461
1449 static void 1462 static void
1450 redraw_blist(const char *name, GaimPrefType type, gconstpointer val, gpointer data) 1463 redraw_blist(const char *name, GaimPrefType type, gconstpointer val, gpointer data)
1451 { 1464 {
1452 GaimBlistNode *node, *sel; 1465 GaimBlistNode *node, *sel;
1453 if (ggblist == NULL) 1466 if (ggblist == NULL || ggblist->window == NULL)
1454 return; 1467 return;
1455 1468
1456 sel = gnt_tree_get_selection_data(GNT_TREE(ggblist->tree)); 1469 sel = gnt_tree_get_selection_data(GNT_TREE(ggblist->tree));
1457 gnt_tree_remove_all(GNT_TREE(ggblist->tree)); 1470 gnt_tree_remove_all(GNT_TREE(ggblist->tree));
1458 node = gaim_blist_get_root(); 1471 node = gaim_blist_get_root();

mercurial