[gtk+/gtk-2-24] Use the actual mime type to determine if an icon is a SVG file.



commit bb39a1292cf2b7987206fe16578baf37734e8337
Author: Michael Schumacher <schumaml gmx de>
Date:   Fri Apr 7 19:45:26 2017 +0200

    Use the actual mime type to determine if an icon is a SVG file.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781020

 gtk/gtkicontheme.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index b4ee484..532d94b 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -2910,6 +2910,7 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo  *icon_info,
       GFile *file;
       GFileInfo *file_info;
       const gchar *content_type;
+      const gchar *mime_type;
 
       file = g_file_icon_get_file (G_FILE_ICON (icon_info->loadable));
       file_info = g_file_query_info (file, 
@@ -2920,11 +2921,16 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo  *icon_info,
         {
           content_type = g_file_info_get_content_type (file_info);
 
-          if (content_type && strcmp (content_type, "image/svg+xml") == 0)
-            is_svg = TRUE;
+          if (content_type)
+            {
+              mime_type = g_content_type_get_mime_type (content_type);
+
+              if (mime_type && strcmp (mime_type, "image/svg+xml") == 0)
+                is_svg = TRUE;
+            }
 
           g_object_unref (file_info);
-       }
+        }
     }
 
   if (is_svg)


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