From: <aar...@us...> - 2006-07-13 19:43:41
|
Revision: 16491 Author: aaronsheldon Date: 2006-07-13 12:43:37 -0700 (Thu, 13 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16491&view=rev Log Message: ----------- Bugfix for resorting list with an expanded buddy, now ought to be about twice as fast for resorts since we don't do it twice anymore, no longer does some unncessary updates on buddys. Every call to gaim_gtk_blist_node(...., TRUE) is unchecked to see if FALSE (faster) will work. TRUE matches the old behavior. Modified Paths: -------------- branches/soc-2006-blist-efficiency/src/gtkblist.c Modified: branches/soc-2006-blist-efficiency/src/gtkblist.c =================================================================== --- branches/soc-2006-blist-efficiency/src/gtkblist.c 2006-07-12 23:53:29 UTC (rev 16490) +++ branches/soc-2006-blist-efficiency/src/gtkblist.c 2006-07-13 19:43:37 UTC (rev 16491) @@ -3164,7 +3164,7 @@ return TRUE; } -static void gaim_gtk_blist_hide_node(GaimBuddyList *list, GaimBlistNode *node) +static void gaim_gtk_blist_hide_node(GaimBuddyList *list, GaimBlistNode *node, gboolean update) { struct _gaim_gtk_blist_node *gtknode = (struct _gaim_gtk_blist_node *)node->ui_data; GtkTreeIter iter; @@ -3176,8 +3176,8 @@ gtkblist->selected_node = NULL; if (get_iter_from_node(node, &iter)) { gtk_tree_store_remove(gtkblist->treemodel, &iter); - if(GAIM_BLIST_NODE_IS_CONTACT(node) || GAIM_BLIST_NODE_IS_BUDDY(node) - || GAIM_BLIST_NODE_IS_CHAT(node)) { + if(update && (GAIM_BLIST_NODE_IS_CONTACT(node) || + GAIM_BLIST_NODE_IS_BUDDY(node) || GAIM_BLIST_NODE_IS_CHAT(node))) { gaim_gtk_blist_update(list, node->parent); } } @@ -3448,7 +3448,7 @@ gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); } - redo_buddy_list(gaim_get_blist(), TRUE); + redo_buddy_list(gaim_get_blist(), FALSE); #if GTK_CHECK_VERSION(2,6,0) gtk_tree_view_columns_autosize(GTK_TREE_VIEW(gtkblist->treeview)); #endif @@ -3994,11 +3994,15 @@ while (node) { + /* This is only needed when we're reverting to a non-GTK+ sorted + * status. We shouldn't need to remove otherwise. + */ + if (remove && !GAIM_BLIST_NODE_IS_GROUP(node)) - gaim_gtk_blist_hide_node(list, node); + gaim_gtk_blist_hide_node(list, node, FALSE); if (GAIM_BLIST_NODE_IS_BUDDY(node)) - gaim_gtk_blist_update_contact(list, node); + gaim_gtk_blist_update_buddy(list, node); else if (GAIM_BLIST_NODE_IS_CHAT(node)) gaim_gtk_blist_update(list, node); node = gaim_blist_node_next(node, FALSE); @@ -4060,7 +4064,7 @@ gaim_request_close_with_handle(node); - gaim_gtk_blist_hide_node(list, node); + gaim_gtk_blist_hide_node(list, node, TRUE); if(node->parent) gaim_gtk_blist_update(list, node->parent); @@ -4228,7 +4232,7 @@ -1); g_free(mark); } else { - gaim_gtk_blist_hide_node(list, gnode); + gaim_gtk_blist_hide_node(list, gnode, TRUE); } } @@ -4350,7 +4354,7 @@ buddy_node(buddy, &iter, cnode); } } else { - gaim_gtk_blist_hide_node(list, cnode); + gaim_gtk_blist_hide_node(list, cnode, TRUE); } } @@ -4383,7 +4387,7 @@ buddy_node(buddy, &iter, node); } else { - gaim_gtk_blist_hide_node(list, node); + gaim_gtk_blist_hide_node(list, node, TRUE); } } @@ -4423,7 +4427,7 @@ if(status) g_object_unref(status); } else { - gaim_gtk_blist_hide_node(list, node); + gaim_gtk_blist_hide_node(list, node, TRUE); } } @@ -5353,8 +5357,11 @@ gaim_gtk_blist_sort_method_set("none"); return; } - redo_buddy_list(gaim_get_blist(), TRUE); - + if (!strcmp(id, "none")) { + redo_buddy_list(gaim_get_blist(), TRUE); + } else { + redo_buddy_list(gaim_get_blist(), FALSE); + } } /****************************************** @@ -5919,8 +5926,8 @@ if (gtk_check_menu_item_get_active(checkmenuitem)) { gaim_gtk_set_cursor(gtkblist->window, GDK_WATCH); - - gaim_gtk_blist_sort_method_set(id); + /* This is redundant. I think. */ + /* gaim_gtk_blist_sort_method_set(id); */ gaim_prefs_set_string("/gaim/gtk/blist/sort_type", id); gaim_gtk_clear_cursor(gtkblist->window); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |