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 30, 2022
1 parent 30ef5f8 commit 47439cc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/filechooser.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,14 @@ 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))
{
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), path);
}
}
else if (strcmp (method_name, "SaveFile") == 0)
{
if (g_variant_lookup (arg_options, "current_name", "&s", &current_name))
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), current_name);
Expand Down

0 comments on commit 47439cc

Please sign in to comment.