Commit 1bc4138a authored by Christian Neumair's avatar Christian Neumair Committed by Christian Neumair

When changing the file name, clear display name if it is not a custom one.

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”.

svn path=/trunk/; revision=14428
parent 04c606a1
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”.
2008-07-30 Christian Neumair <cneumair@gnome.org>
* src/nautilus-navigation-window-slot.c
* src/nautilus-window-slot.c (real_update_query_editor),
(nautilus_window_slot_update_query_editor):
Use weak pointer for being notified about query editor destruction.
2008-07-30 Christian Neumair <cneumair@gnome.org>
* src/nautilus-navigation-window.c
......
......@@ -288,6 +288,18 @@ nautilus_file_set_display_name (NautilusFile *file,
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 @@ nautilus_file_clear_info (NautilusFile *file)
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 @@ update_info_internal (NautilusFile *file,
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 @@ update_info_internal (NautilusFile *file,
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 @@ update_name_internal (NautilusFile *file,
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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment