[gtk] widget-factory: Skip xml files in background selection dialog



commit bcd894176989056774345bc35cee0a18a619d090
Author: Timm Bäder <mail baedert org>
Date:   Sun Sep 29 08:39:12 2019 +0200

    widget-factory: Skip xml files in background selection dialog
    
    The default contains a xml file for an animated background, so don't try
    loading it as a pixbuf.

 demos/widget-factory/widget-factory.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index 5be2f97dac..4af47abf0d 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -1003,6 +1003,9 @@ populate_flowbox (GtkWidget *flowbox)
 
   while ((name = g_dir_read_name (dir)) != NULL)
     {
+      if (g_str_has_suffix (name, ".xml"))
+        continue;
+
       filename = g_build_filename (location, name, NULL);
       file = g_file_new_for_path (filename);
       stream = G_INPUT_STREAM (g_file_read (file, NULL, &error));
@@ -1017,7 +1020,7 @@ populate_flowbox (GtkWidget *flowbox)
           bd = g_new (BackgroundData, 1);
           bd->flowbox = flowbox;
           bd->filename = filename;
-          gdk_pixbuf_new_from_stream_at_scale_async (stream, 110, 110, TRUE, NULL, 
+          gdk_pixbuf_new_from_stream_at_scale_async (stream, 110, 110, TRUE, NULL,
                                                      background_loaded_cb, bd);
         }
 


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