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 Jun 30, 2023
1 parent 9abacd6 commit 7851aac
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 @@ -641,7 +641,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 7851aac

Please sign in to comment.