Adapt to simplified file chooser portal api

OpenFiles is gone, just set the 'multiple' option instead.

https://bugzilla.gnome.org/show_bug.cgi?id=768499
This commit is contained in:
Matthias Clasen 2016-07-06 12:54:29 -04:00
parent 445d12e5cb
commit 2b77eaa1ae

View File

@ -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));