From 7ec6f9375c318e8f900a471bb2dc2df5dd24fb65 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 30 May 2007 12:27:47 +0000 Subject: [PATCH] Fix to update the file chooser entry Return after setting the file chooser entry instead of falling through. Also remove the handling for the search and recent files operation modes, since they don't have a location entry to update. svn path=/trunk/; revision=17983 --- ChangeLog | 5 +++++ gtk/gtkfilechooserdefault.c | 17 ++--------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a3838cc9f..cda28fe76c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-05-30 Emmanuele Bassi + + * gtk/gtkfilechooserdefault.c (update_chooser_entry): Return + after setting the file chooser entry with the current selection. + 2007-05-30 Matthias Clasen * gtk/gtkiconcachevalidator.c: Correct the handling diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 5daafabc5e..9a9a4b27ed 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -6702,6 +6702,7 @@ update_chooser_entry (GtkFileChooserDefault *impl) struct update_chooser_entry_selected_foreach_closure closure; const char *file_part; + /* no need to update the file chooser's entry if there's no entry */ if (impl->operation_mode == OPERATION_MODE_SEARCH || impl->operation_mode == OPERATION_MODE_RECENT || !impl->location_entry) @@ -6761,20 +6762,7 @@ update_chooser_entry (GtkFileChooserDefault *impl) _gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), impl->browse_files_last_selected_name); - } - else if (impl->operation_mode == OPERATION_MODE_SEARCH) - { - search_get_valid_child_iter (impl, &child_iter, &closure.first_selected_iter); - gtk_tree_model_get (GTK_TREE_MODEL (impl->search_model), &child_iter, - SEARCH_MODEL_COL_DISPLAY_NAME, &file_part, - -1); - } - else if (impl->operation_mode == OPERATION_MODE_RECENT) - { - recent_get_valid_child_iter (impl, &child_iter, &closure.first_selected_iter); - gtk_tree_model_get (GTK_TREE_MODEL (impl->recent_model), &child_iter, - RECENT_MODEL_COL_DISPLAY_NAME, &file_part, - -1); + return; } } else @@ -10479,7 +10467,6 @@ list_selection_changed (GtkTreeSelection *selection, out: - /* TODO - Change the following functions to make them accept MODE_SEARCH */ if (impl->location_entry) update_chooser_entry (impl);