[nautilus/undo-manager] file: only populate undo/redo actions if we're not undoing/redoing



commit 39cc0f792acaa8a1f235bdcabe71f4e4364504f9
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Dec 7 16:50:02 2010 +0100

    file: only populate undo/redo actions if we're not undoing/redoing

 libnautilus-private/nautilus-file.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 106e9ba..c23bec8 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -1658,7 +1658,9 @@ nautilus_file_operation_free (NautilusFileOperation *op)
 		op->free_data (op->data);
 	}
 
-	nautilus_undo_stack_manager_add_action (nautilus_undo_stack_manager_get (), op->undo_redo_data);
+	if (op->undo_redo_data != NULL) {
+		nautilus_undo_stack_manager_add_action (nautilus_undo_stack_manager_get (), op->undo_redo_data);
+	}
 
 	g_free (op);
 }
@@ -1764,9 +1766,9 @@ rename_callback (GObject *source_object,
 						   res, &error);
 
 	if (new_file != NULL) {
-
-
-		nautilus_undo_stack_action_data_set_rename_information (op->undo_redo_data, G_FILE (source_object), new_file);
+		if (op->undo_redo_data != NULL) {
+			nautilus_undo_stack_action_data_set_rename_information (op->undo_redo_data, G_FILE (source_object), new_file);
+		}
 
 		g_file_query_info_async (new_file,
 					 NAUTILUS_FILE_DEFAULT_ATTRIBUTES,
@@ -5390,12 +5392,14 @@ nautilus_file_set_owner (NautilusFile *file,
 
 		current_owner = nautilus_file_get_owner_as_string (file, FALSE);
 		undo_redo_data = nautilus_undo_stack_action_data_new (NAUTILUS_UNDO_STACK_CHANGE_OWNER, 1);
+
 		nautilus_undo_stack_action_data_set_owner_change_information (undo_redo_data,
 		                                                              nautilus_file_get_location (file),
 		                                                              current_owner,
 		                                                              user_name_or_id);
 		nautilus_undo_stack_manager_add_action (nautilus_undo_stack_manager_get (), undo_redo_data);
-		g_free(current_owner);
+
+		g_free (current_owner);
 	}
 
 	info = g_file_info_new ();
@@ -5667,11 +5671,13 @@ nautilus_file_set_group (NautilusFile *file,
 
 		current_group = nautilus_file_get_group_name (file);
 		undo_redo_data = nautilus_undo_stack_action_data_new (NAUTILUS_UNDO_STACK_CHANGE_GROUP, 1);
+
 		nautilus_undo_stack_action_data_set_group_change_information (undo_redo_data,
 		                                                              nautilus_file_get_location (file),
 		                                                              current_group,
 		                                                              group_name_or_id);
 		nautilus_undo_stack_manager_add_action (nautilus_undo_stack_manager_get (), undo_redo_data);
+
 		g_free (current_group);
 	}
 



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