[PATCH] Don't append final newline when copying URIs to text clipboard target



Reported as bug 360441 [1], proposed patch attached.

I wonder whether we should convert the URIs to
  "uri1, ..., uriN"
instead of
  "uri1\n...\nuriN" .u

[1] http://bugzilla.gnome.org/show_bug.cgi?id=360441

-- 
Christian Neumair <chris gnome-de org>
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.750
diff -u -p -r1.750 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	8 Aug 2006 14:43:25 -0000	1.750
+++ src/file-manager/fm-directory-view.c	7 Oct 2006 18:12:25 -0000
@@ -2062,8 +2062,6 @@ fm_directory_view_destroy (GtkObject *ob
 		view->details->directory_as_file = NULL;
 	}
 
-	fm_directory_view_ignore_hidden_file_preferences (view);
-
 	EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
 }
 
@@ -2074,10 +2072,15 @@ fm_directory_view_finalize (GObject *obj
 
 	view = FM_DIRECTORY_VIEW (object);
 
-	eel_preferences_remove_callback (NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
-					 filtering_changed_callback, view);
-	eel_preferences_remove_callback (NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES,
-					 filtering_changed_callback, view);
+	if (!view->details->ignore_hidden_file_preferences) {
+		/* fm_directory_view_ignore_hidden_file_preferences is a one-way switch,
+		 * removed these callbacks already.
+		 */
+		eel_preferences_remove_callback (NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
+						 filtering_changed_callback, view);
+		eel_preferences_remove_callback (NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES,
+						 filtering_changed_callback, view);
+	}
 	eel_preferences_remove_callback (NAUTILUS_PREFERENCES_CONFIRM_TRASH,
 					 schedule_update_menus_callback, view);
 	eel_preferences_remove_callback (NAUTILUS_PREFERENCES_ENABLE_DELETE,
@@ -5890,8 +5893,11 @@ convert_file_list_to_string (GList *file
 			} else {
 				g_string_append (uris, uri);
 			}
-			g_string_append_c (uris, '\n');
-			
+
+			/* skip newline for last element */
+			if (node->next != NULL) {
+				g_string_append_c (uris, '\n');
+			}
 		} else {
 			g_string_append_c (uris, '\n');
 			g_string_append (uris, uri);


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