[gtk+/portal2: 10/19] Adapt to simplified file chooser portal api
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/portal2: 10/19] Adapt to simplified file chooser portal api
- Date: Thu, 7 Jul 2016 04:11:14 +0000 (UTC)
commit 68f8b21ae417ee019b65c506ba210d0b0289ba13
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Jul 6 12:54:29 2016 -0400
Adapt to simplified file chooser portal api
OpenFiles is gone, just set the 'multiple' option instead.
gtk/gtkfilechoosernativeportal.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkfilechoosernativeportal.c b/gtk/gtkfilechoosernativeportal.c
index a8e0fc7..8ff2a46 100644
--- a/gtk/gtkfilechoosernativeportal.c
+++ b/gtk/gtkfilechoosernativeportal.c
@@ -298,10 +298,8 @@ gtk_file_chooser_native_portal_show (GtkFileChooserNative *self)
action = gtk_file_chooser_get_action (GTK_FILE_CHOOSER (self));
multiple = gtk_file_chooser_get_select_multiple (GTK_FILE_CHOOSER (self));
- if (action == GTK_FILE_CHOOSER_ACTION_OPEN && !multiple)
+ if (action == GTK_FILE_CHOOSER_ACTION_OPEN)
method_name = "OpenFile";
- else if (action == GTK_FILE_CHOOSER_ACTION_OPEN && multiple)
- method_name = "OpenFiles";
else if (action == GTK_FILE_CHOOSER_ACTION_SAVE)
method_name = "SaveFile";
else
@@ -345,6 +343,8 @@ gtk_file_chooser_native_portal_show (GtkFileChooserNative *self)
}
g_variant_builder_init (&opt_builder, G_VARIANT_TYPE_VARDICT);
+ g_variant_builder_add (&opt_builder, "{sv}", "multiple",
+ g_variant_new_boolean (multiple));
if (self->accept_label)
g_variant_builder_add (&opt_builder, "{sv}", "accept_label",
g_variant_new_string (self->accept_label));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]