[nautilus] view: don't update undo actions for inactive views



commit 4d2c8c1ad1169d592ea27e4eeb364380cb8d60f6
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Jul 2 12:52:16 2012 -0400

    view: don't update undo actions for inactive views
    
    If the view is not active, our menus are not merged in, so we shouldn't
    try to update the relative actions underway, as they're not in the
    action group.
    
    This fixes crashers/warnings when doing a file operation with more than
    one view open.

 src/nautilus-view.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index aed85b6..20b96d1 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -2546,6 +2546,10 @@ static void
 undo_manager_changed_cb (NautilusFileUndoManager* manager,
 			 NautilusView *view)
 {
+	if (!view->details->active) {
+		return;
+	}
+
 	update_undo_actions (view);
 }
 
@@ -2602,7 +2606,6 @@ nautilus_view_init (NautilusView *view)
 	NautilusDirectory *scripts_directory;
 	NautilusDirectory *templates_directory;
 	char *templates_uri;
-	NautilusFileUndoManager* manager;
 
 	view->details = G_TYPE_INSTANCE_GET_PRIVATE (view, NAUTILUS_TYPE_VIEW,
 						     NautilusViewDetails);
@@ -2677,9 +2680,8 @@ nautilus_view_init (NautilusView *view)
 				  "changed::" NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE,
 				  G_CALLBACK (schedule_update_menus), view);
 
-	manager = nautilus_file_undo_manager_get ();
-	g_signal_connect_object (manager, "undo-changed",
-				 G_CALLBACK (undo_manager_changed_cb), view, 0);				  
+	g_signal_connect_object (nautilus_file_undo_manager_get (), "undo-changed",
+				 G_CALLBACK (undo_manager_changed_cb), view, 0);
 
 	/* Accessibility */
 	atk_object = gtk_widget_get_accessible (GTK_WIDGET (view));



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