[gtk+/gtk-3-22] Avoid a critical warning in the filechooser portal



commit b04a863328f2ff64462b8bbbd2f28bcfd09ec667
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Mar 17 19:56:33 2017 -0400

    Avoid a critical warning in the filechooser portal
    
    This was showing up when cancelling a portal file chooser
    in recipes.

 gtk/gtkfilechoosernativeportal.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkfilechoosernativeportal.c b/gtk/gtkfilechoosernativeportal.c
index 981e0d5..45ceb3f 100644
--- a/gtk/gtkfilechoosernativeportal.c
+++ b/gtk/gtkfilechoosernativeportal.c
@@ -110,15 +110,17 @@ response_cb (GDBusConnection  *connection,
 
   choices = g_variant_lookup_value (response_data, "choices", G_VARIANT_TYPE ("a(ss)"));
   if (choices)
-    for (i = 0; i < g_variant_n_children (choices); i++)
-      {
-        const char *id;
-        const char *selected;
-        g_variant_get_child (choices, i, "(&s&s)", &id, &selected);
-        gtk_file_chooser_set_choice (GTK_FILE_CHOOSER (self), id, selected);
-      }
-
-  g_variant_unref (choices);
+    {
+      for (i = 0; i < g_variant_n_children (choices); i++)
+        {
+          const char *id;
+          const char *selected;
+          g_variant_get_child (choices, i, "(&s&s)", &id, &selected);
+          gtk_file_chooser_set_choice (GTK_FILE_CHOOSER (self), id, selected);
+        }
+      g_variant_unref (choices);
+    }
+
   g_slist_free_full (self->custom_files, g_object_unref);
   self->custom_files = NULL;
   for (i = 0; uris[i]; i++)


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