forked from AuroraMiddleware/gtk
Allow switching to recent:/// even though GIO thinks it is not a native file
That URI is not a native file, and so it would not show up if local_only=TRUE. Add a special case for it so that recent:/// can always be visited. Signed-off-by: Federico Mena Quintero <federico@gnome.org>
This commit is contained in:
parent
791bd3cec2
commit
f623329e95
@ -7544,6 +7544,19 @@ out:
|
||||
g_object_unref (cancellable);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
file_is_recent_uri (GFile *file)
|
||||
{
|
||||
GFile *recent;
|
||||
gboolean same;
|
||||
|
||||
recent = g_file_new_for_uri ("recent:///");
|
||||
same = g_file_equal (file, recent);
|
||||
g_object_unref (recent);
|
||||
|
||||
return same;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_file_chooser_default_update_current_folder (GtkFileChooser *chooser,
|
||||
GFile *file,
|
||||
@ -7560,7 +7573,8 @@ gtk_file_chooser_default_update_current_folder (GtkFileChooser *chooser,
|
||||
|
||||
operation_mode_set (impl, OPERATION_MODE_BROWSE);
|
||||
|
||||
if (impl->local_only && !g_file_is_native (file))
|
||||
if (impl->local_only && !g_file_is_native (file)
|
||||
&& !file_is_recent_uri (file)) /* GIO considers "recent:///" to be non-native; we special-case it so recent files *will* show up */
|
||||
{
|
||||
g_set_error_literal (error,
|
||||
GTK_FILE_CHOOSER_ERROR,
|
||||
|
Loading…
Reference in New Issue
Block a user