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 eef818e commit f9e70c7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions data/org.freedesktop.impl.portal.FileChooser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@
Whether the file is opened with write access. Default is no.
</para></listitem>
</varlistentry>
<varlistentry>
<term>current_folder ay</term>
<listitem><para>
A suggested folder to open the files from.
</para></listitem>
</varlistentry>
</variablelist>
-->
<method name="OpenFile">
Expand Down
9 changes: 9 additions & 0 deletions data/org.freedesktop.portal.FileChooser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,15 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>current_folder ay</term>
<listitem>
<para>
Suggested folder to select the files from. The byte array is
expected to be null-terminated.
</para>
</listitem>
</varlistentry>
</variablelist>
-->
<method name="SaveFile">
Expand Down
3 changes: 2 additions & 1 deletion src/file-chooser.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@ static XdpOptionKey open_file_options[] = {
{ "directory", G_VARIANT_TYPE_BOOLEAN, NULL },
{ "filters", (const GVariantType *)"a(sa(us))", validate_filters },
{ "current_filter", (const GVariantType *)"(sa(us))", validate_current_filter },
{ "choices", (const GVariantType *)"a(ssa(ss)s)", validate_choices }
{ "choices", (const GVariantType *)"a(ssa(ss)s)", validate_choices },
{ "current_folder", G_VARIANT_TYPE_BYTESTRING, NULL }
};

static gboolean
Expand Down

0 comments on commit f9e70c7

Please sign in to comment.