[gnome-builder] project-file: Show overridden symbolic icon for the MIME type



commit 014c5b0d7bd1de491996e734a1950d92ca8b2504
Author: vanadiae <vanadiae35 gmail com>
Date:   Wed Dec 23 23:10:20 2020 +0100

    project-file: Show overridden symbolic icon for the MIME type
    
    Currently the icon associated for a MIME type was meant to either be
    picked either from the custom overridden icons included in Builder,
    mostly programming languages related, or from the default theme ones, if
    available.
    
    But there was a bug where the content type used to choose the custom
    icon bundled in Builder only checked for the MIME type by file name
    (like if the file ends with .xml), by using the "fast" content type
    detection. This made pretty much every custom icons not to be used as
    not correctly detected it, and hence very few icons were shown in the
    project tree sidebar.
    
    So this commit fixes this by using the normal content type detection
    instead of the "fast".

 src/libide/projects/ide-project-file.c | 3 ++-
 src/libide/projects/ide-project-file.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/libide/projects/ide-project-file.c b/src/libide/projects/ide-project-file.c
index 7ae36dac8..05dfb8748 100644
--- a/src/libide/projects/ide-project-file.c
+++ b/src/libide/projects/ide-project-file.c
@@ -121,7 +121,8 @@ ide_project_file_set_property (GObject      *object,
     case PROP_INFO:
       priv->info = g_value_dup_object (value);
       if (priv->info &&
-          g_file_info_has_attribute (priv->info, G_FILE_ATTRIBUTE_STANDARD_NAME))
+          g_file_info_has_attribute (priv->info, G_FILE_ATTRIBUTE_STANDARD_NAME) &&
+          g_file_info_has_attribute (priv->info, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE))
         break;
       /* Fall-through */
     default:
diff --git a/src/libide/projects/ide-project-file.h b/src/libide/projects/ide-project-file.h
index 36023e831..4ff96a921 100644
--- a/src/libide/projects/ide-project-file.h
+++ b/src/libide/projects/ide-project-file.h
@@ -34,7 +34,7 @@ G_BEGIN_DECLS
 #define IDE_PROJECT_FILE_ATTRIBUTES \
   G_FILE_ATTRIBUTE_STANDARD_NAME"," \
   G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME"," \
-  G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE"," \
+  G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE"," \
   G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON"," \
   G_FILE_ATTRIBUTE_STANDARD_TYPE"," \
   G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK"," \


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