nautilus r14428 - in trunk: . libnautilus-private



Author: cneumair
Date: Wed Jul 30 14:18:52 2008
New Revision: 14428
URL: http://svn.gnome.org/viewvc/nautilus?rev=14428&view=rev

Log:
2008-07-30  Christian Neumair  <cneumair gnome org>

	* libnautilus-private/nautilus-file.c
	(nautilus_file_clear_display_name), (nautilus_file_clear_info),
	(update_info_internal), (update_name_internal):
	When changing the file name, clear display name if it is not a custom
	one. Custom means ânot provided by GFileInfoâ.


Modified:
   trunk/ChangeLog
   trunk/libnautilus-private/nautilus-file.c

Modified: trunk/libnautilus-private/nautilus-file.c
==============================================================================
--- trunk/libnautilus-private/nautilus-file.c	(original)
+++ trunk/libnautilus-private/nautilus-file.c	Wed Jul 30 14:18:52 2008
@@ -288,6 +288,18 @@
 	return changed;
 }
 
+static void
+nautilus_file_clear_display_name (NautilusFile *file)
+{
+	eel_ref_str_unref (file->details->display_name);
+	file->details->display_name = NULL;
+	g_free (file->details->display_name_collation_key);
+	file->details->display_name_collation_key = NULL;
+	eel_ref_str_unref (file->details->edit_name);
+	file->details->edit_name = NULL;
+}
+
+
 void
 nautilus_file_clear_info (NautilusFile *file)
 {
@@ -301,12 +313,7 @@
 	file->details->type = NAUTILUS_FILE_GET_CLASS (file)->default_file_type;
 
 	if (!file->details->got_custom_display_name) {
-		eel_ref_str_unref (file->details->display_name);
-		file->details->display_name = NULL;
-		g_free (file->details->display_name_collation_key);
-		file->details->display_name_collation_key = NULL;
-		eel_ref_str_unref (file->details->edit_name);
-		file->details->edit_name = NULL;
+		nautilus_file_clear_display_name (file);
 	}
 
 	if (!file->details->got_custom_activation_location &&
@@ -1845,6 +1852,8 @@
 		name = g_file_info_get_name (info);
 		if (file->details->name == NULL ||
 		    strcmp (eel_ref_str_peek (file->details->name), name) != 0) {
+			changed = TRUE;
+
 			node = nautilus_directory_begin_file_name_change
 				(file->details->directory, file);
 			
@@ -1856,6 +1865,10 @@
 				file->details->name = eel_ref_str_new (name);
 			}
 
+			if (!file->details->got_custom_display_name) {
+				nautilus_file_clear_display_name (file);
+			}
+
 			nautilus_directory_end_file_name_change
 				(file->details->directory, file, node);
 		}
@@ -1909,7 +1922,11 @@
 	
 	eel_ref_str_unref (file->details->name);
 	file->details->name = eel_ref_str_new (name);
-	
+
+	if (!file->details->got_custom_display_name) {
+		nautilus_file_clear_display_name (file);
+	}
+
 	if (in_directory) {
 		nautilus_directory_end_file_name_change
 			(file->details->directory, file, node);



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