[gtk/wip/baedert/icontheme: 13/18] icontheme: Save the min_suffix for the min_dir



commit 292cff622bfa33373989bdad1f6fc2e9e4c8e760
Author: Timm Bäder <mail baedert org>
Date:   Sat May 25 16:51:30 2019 +0200

    icontheme: Save the min_suffix for the min_dir
    
    We already have to compute that value in the loop before, so just save
    it.

 gtk/gtkicontheme.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index c1cef836f7..4d2723e8b0 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -2915,6 +2915,7 @@ theme_lookup_icon (IconTheme   *theme,
   gchar *file;
   gint min_difference, difference;
   IconSuffix suffix;
+  IconSuffix min_suffix;
 
   min_difference = G_MAXINT;
   min_dir = NULL;
@@ -2937,6 +2938,7 @@ theme_lookup_icon (IconTheme   *theme,
                                    size, scale))
             {
               min_dir = dir;
+              min_suffix = suffix;
               min_difference = difference;
             }
         }
@@ -2952,7 +2954,7 @@ theme_lookup_icon (IconTheme   *theme,
       icon_info->min_size = min_dir->min_size;
       icon_info->max_size = min_dir->max_size;
 
-      suffix = theme_dir_get_icon_suffix (min_dir, icon_name);
+      suffix = min_suffix;
       suffix = best_suffix (suffix, allow_svg);
       g_assert (suffix != ICON_SUFFIX_NONE);
 


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