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
This commit is contained in:
Emmanuele Bassi 2007-05-30 12:27:47 +00:00
parent 8bd39297a6
commit 7ec6f9375c
2 changed files with 7 additions and 15 deletions

View File

@ -1,3 +1,8 @@
2007-05-30 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkfilechooserdefault.c (update_chooser_entry): Return
after setting the file chooser entry with the current selection.
2007-05-30 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkiconcachevalidator.c: Correct the handling

View File

@ -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);