From 9ed65c56203c6db7176ca3f8f8eeaa941f1cc402 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 27 Jul 2011 17:30:05 -0500 Subject: [PATCH] Only unset the entry's contents if the entry exists Signed-off-by: Federico Mena Quintero --- gtk/gtkfilechooserdefault.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 2952fd85f0..308cd447f1 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -9825,7 +9825,10 @@ shortcuts_activate_iter (GtkFileChooserDefault *impl, gpointer col_data; ShortcutType shortcut_type; - if (impl->location_mode == LOCATION_MODE_FILENAME_ENTRY + /* In the Save modes, we want to preserve what the uesr typed in the filename + * entry, so that he may choose another folder without erasing his typed name. + */ + if (impl->location_entry && !(impl->action == GTK_FILE_CHOOSER_ACTION_SAVE || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)) _gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), "");