nautilus r14845 - in trunk: . libnautilus-private
- From: alexl svn gnome org
- To: svn-commits-list gnome org
- Subject: nautilus r14845 - in trunk: . libnautilus-private
- Date: Tue, 13 Jan 2009 09:32:50 +0000 (UTC)
Author: alexl
Date: Tue Jan 13 09:32:50 2009
New Revision: 14845
URL: http://svn.gnome.org/viewvc/nautilus?rev=14845&view=rev
Log:
2009-01-13 Alexander Larsson <alexl redhat com>
* libnautilus-private/nautilus-icon-container.c:
* libnautilus-private/nautilus-icon-private.h:
Only send selection_changed once when removing lots of files.
Modified:
trunk/ChangeLog
trunk/libnautilus-private/nautilus-icon-container.c
trunk/libnautilus-private/nautilus-icon-private.h
Modified: trunk/libnautilus-private/nautilus-icon-container.c
==============================================================================
--- trunk/libnautilus-private/nautilus-icon-container.c (original)
+++ trunk/libnautilus-private/nautilus-icon-container.c Tue Jan 13 09:32:50 2009
@@ -3983,6 +3983,10 @@
container->details->align_idle_id = 0;
}
+ if (container->details->selection_changed_id != 0) {
+ g_source_remove (container->details->selection_changed_id);
+ container->details->selection_changed_id = 0;
+ }
/* destroy interactive search dialog */
if (container->details->search_window) {
@@ -6591,6 +6595,20 @@
call_icon_callback, &callback_and_data);
}
+static int
+selection_changed_at_idle_callback (gpointer data)
+{
+ NautilusIconContainer *container;
+
+ container = NAUTILUS_ICON_CONTAINER (data);
+
+ g_signal_emit (container,
+ signals[SELECTION_CHANGED], 0);
+
+ container->details->selection_changed_id = 0;
+ return FALSE;
+}
+
/* utility routine to remove a single icon from the container */
static void
@@ -6654,8 +6672,8 @@
icon_free (icon);
if (was_selected) {
- g_signal_emit (container,
- signals[SELECTION_CHANGED], 0);
+ /* Coalesce multiple removals causing multiple selection_changed events */
+ details->selection_changed_id = g_idle_add (selection_changed_at_idle_callback, container);
}
}
Modified: trunk/libnautilus-private/nautilus-icon-private.h
==============================================================================
--- trunk/libnautilus-private/nautilus-icon-private.h (original)
+++ trunk/libnautilus-private/nautilus-icon-private.h Tue Jan 13 09:32:50 2009
@@ -146,6 +146,9 @@
guint keyboard_icon_reveal_timer_id;
NautilusIcon *keyboard_icon_to_reveal;
+ /* Used to coalesce selection changed signals in some cases */
+ guint selection_changed_id;
+
/* If a request is made to reveal an unpositioned icon we remember
* it and reveal it once it gets positioned (in relayout).
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]