Skip to content

Commit

Permalink
filechooser: Support current_folder with OpenFile
Browse files Browse the repository at this point in the history
  • Loading branch information
sophie-h committed Aug 29, 2022
1 parent b33d02e commit 490eb49
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/filechooser.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,15 @@ handle_open (XdpImplFileChooser *object,
}
g_slist_free_full (filters, g_object_unref);

if (strcmp (method_name, "SaveFile") == 0)
if (strcmp (method_name, "OpenFile") == 0)
{
if (g_variant_lookup (arg_options, "current_folder", "^&ay", &path))
{
g_autoptr(GFile) file = g_file_new_for_path (path);
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), file, NULL);
}
}
else if (strcmp (method_name, "SaveFile") == 0)
{
/* TODO: is this useful ?
* In a sandboxed situation, the current folder and current file
Expand Down

0 comments on commit 490eb49

Please sign in to comment.