[gtk+/wip/alexl/file-chooser-portal] portal: Sent more data along



commit a97997ce3a9e149f9fedb85c92e8e01fe922d497
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jun 11 01:30:50 2016 -0400

    portal: Sent more data along
    
    Send the current_name, current_folder or current_file fields to
    the portal.

 gtk/gtkfilechoosernativeportal.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkfilechoosernativeportal.c b/gtk/gtkfilechoosernativeportal.c
index 13a5dbb..2dc10eb 100644
--- a/gtk/gtkfilechoosernativeportal.c
+++ b/gtk/gtkfilechoosernativeportal.c
@@ -346,6 +346,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})",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]