Re: [PATCH] Block selection_changed in fm_list_view_set_selection



On Fri, 2004-10-01 at 18:26 +0200, Martin Wehner wrote:
> When you call fm_list_view_set_selection with a large selection, you get
> a selection_changed notification for every file in the selection. This
> patch blocks the selection_changed handler and sends one notification
> afterwards.
> 
> Martin

Oops, extra space :p

? mkinstalldirs
Index: src/file-manager/fm-list-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-list-view.c,v
retrieving revision 1.228
diff -u -p -w -r1.228 fm-list-view.c
--- src/file-manager/fm-list-view.c	6 Sep 2004 09:00:51 -0000	1.228
+++ src/file-manager/fm-list-view.c	1 Oct 2004 16:35:16 -0000
@@ -1415,6 +1415,8 @@ fm_list_view_set_selection (FMDirectoryV
 	list_view = FM_LIST_VIEW (view);
 	tree_selection = gtk_tree_view_get_selection (list_view->details->tree_view);
 
+	g_signal_handlers_block_by_func (tree_selection, list_selection_changed_callback, view);
+
 	gtk_tree_selection_unselect_all (tree_selection);
 	for (node = selection; node != NULL; node = node->next) {
 		file = node->data;
@@ -1422,6 +1424,9 @@ fm_list_view_set_selection (FMDirectoryV
 			gtk_tree_selection_select_iter (tree_selection, &iter);
 		}
 	}
+
+	g_signal_handlers_unblock_by_func (tree_selection, list_selection_changed_callback, view);
+	fm_directory_view_notify_selection_changed (view);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]