GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Set the filename entry's base folder when a recent-folder is selected

This lets the filename entry do completion relative to the selected recent-folder.
Signed-off-by: Federico Mena Quintero's avatarFederico Mena Quintero <federico@gnome.org>
parent e6ceb422
......@@ -6578,7 +6578,6 @@ update_chooser_entry (GtkFileChooserDefault *impl)
/* 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)
return;
......@@ -6597,7 +6596,10 @@ update_chooser_entry (GtkFileChooserDefault *impl)
if (closure.num_selected == 0)
{
goto maybe_clear_entry;
if (impl->operation_mode == OPERATION_MODE_RECENT)
_gtk_file_chooser_entry_set_base_folder (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), NULL);
else
goto maybe_clear_entry;
}
else if (closure.num_selected == 1)
{
......@@ -6638,6 +6640,20 @@ update_chooser_entry (GtkFileChooserDefault *impl)
return;
}
else if (impl->operation_mode == OPERATION_MODE_RECENT
&& impl->action == GTK_FILE_CHOOSER_ACTION_SAVE)
{
GFile *folder;
/* Set the base folder on the name entry, so it will do completion relative to the correct recent-folder */
gtk_tree_model_get (GTK_TREE_MODEL (impl->recent_model), &closure.first_selected_iter,
MODEL_COL_FILE, &folder,
-1);
_gtk_file_chooser_entry_set_base_folder (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), folder);
g_object_unref (folder);
return;
}
}
else
{
......
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