[gnome-control-center/allow-all-images-as-background] background: Allow all images




commit 97072a66e5e86e0cfab9690029d66688bb74eae4
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Aug 25 09:23:42 2022 -0400

    background: Allow all images
    
    The code was filtering with a small list of known
    image mimetypes, needlessly. Just allow any
    image/* mimetypes.
    
    Fixes: #2036

 panels/background/bg-recent-source.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
---
diff --git a/panels/background/bg-recent-source.c b/panels/background/bg-recent-source.c
index 11773279e..32d18547f 100644
--- a/panels/background/bg-recent-source.c
+++ b/panels/background/bg-recent-source.c
@@ -41,17 +41,6 @@ struct _BgRecentSource
 
 G_DEFINE_TYPE (BgRecentSource, bg_recent_source, BG_TYPE_SOURCE)
 
-
-static const gchar * const content_types[] = {
-       "image/png",
-       "image/jp2",
-       "image/jpeg",
-       "image/bmp",
-       "image/svg+xml",
-       "image/x-portable-anymap",
-       NULL
-};
-
 static int
 sort_func (gconstpointer a,
            gconstpointer b,
@@ -89,7 +78,7 @@ add_file_from_info (BgRecentSource *self,
   content_type = g_file_info_get_content_type (info);
   mtime = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
 
-  if (!content_type || !g_strv_contains (content_types, content_type))
+  if (!content_type || !g_content_type_is_a (content_type, "image/*"))
     return;
 
   uri = g_file_get_uri (file);


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