summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechoosernativeportal.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-06-11 01:30:50 -0400
committerMatthias Clasen <mclasen@redhat.com>2016-07-08 00:07:59 -0400
commit3b3e1eca2bc3accff3960dfc2394d1deb5e7ea20 (patch)
tree2860e13a4a54de60a42619fc8880278bf53be9bf /gtk/gtkfilechoosernativeportal.c
parent0acb6a0e9836d0d7d565b3eb3461809a3d0615d6 (diff)
downloadgtk+-3b3e1eca2bc3accff3960dfc2394d1deb5e7ea20.tar.gz
portal: Sent more data along
Send the current_name, current_folder or current_file fields to the portal. https://bugzilla.gnome.org/show_bug.cgi?id=768499
Diffstat (limited to 'gtk/gtkfilechoosernativeportal.c')
-rw-r--r--gtk/gtkfilechoosernativeportal.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gtk/gtkfilechoosernativeportal.c b/gtk/gtkfilechoosernativeportal.c
index d0bd149e13..348c402bd7 100644
--- a/gtk/gtkfilechoosernativeportal.c
+++ b/gtk/gtkfilechoosernativeportal.c
@@ -357,6 +357,27 @@ gtk_file_chooser_native_portal_show (GtkFileChooserNative *self)
g_variant_builder_add (&opt_builder, "{sv}", "modal",
g_variant_new_boolean (data->modal));
g_variant_builder_add (&opt_builder, "{sv}", "filters", get_filters (GTK_FILE_CHOOSER (self)));
+ if (GTK_FILE_CHOOSER_NATIVE (self)->current_name)
+ g_variant_builder_add (&opt_builder, "{sv}", "current_name",
+ g_variant_new_string (GTK_FILE_CHOOSER_NATIVE (self)->current_name));
+ if (GTK_FILE_CHOOSER_NATIVE (self)->current_folder)
+ {
+ gchar *path;
+
+ path = g_file_get_path (GTK_FILE_CHOOSER_NATIVE (self)->current_folder);
+ g_variant_builder_add (&opt_builder, "{sv}", "current_folder",
+ g_variant_new_bytestring (path));
+ g_free (path);
+ }
+ if (GTK_FILE_CHOOSER_NATIVE (self)->current_file)
+ {
+ gchar *path;
+
+ path = g_file_get_path (GTK_FILE_CHOOSER_NATIVE (self)->current_file);
+ g_variant_builder_add (&opt_builder, "{sv}", "current_file",
+ g_variant_new_bytestring (path));
+ g_free (path);
+ }
g_dbus_message_set_body (message,
g_variant_new ("(ss@a{sv})",