[gimp/gimp-2-10] libgimpwidgets: fix setting GimpMemSizeEntry value with unit change.



commit 35c9e0a213f613a7cb660aad052f7ecc8ec2c8ce
Author: Jehan <jehan girinstud io>
Date:   Wed Aug 5 12:30:21 2020 +0200

    libgimpwidgets: fix setting GimpMemSizeEntry value with unit change.
    
    This bug doesn't happen when setting value through the GUI as in such
    case, the unit never changed. It happened when setting a value which
    could not be properly displayed by current unit (typically smaller than
    1 in this unit, or with remainder).
    In such a case, we should not manually set private->shift before
    gimp_int_combo_box_set_active(), or the callback was failing to
    reconfigure the GtkAdjustement, in particular min and max values.
    
    As a consequence, hitting a Preferences reset, with a GimpMemSizeEntry
    in Gigabytes, it got reset to Kilobytes with the max values capped at
    4096. So I realized a Reset ended me with a Tile cache size of 4096 KB
    in particular, which is of course ridiculously small and would be a
    problem if one doesn't notice the issue immediately.
    
    (cherry picked from commit 0be4e5c1dcf6b8719319c67b7dd8115860208439)

 libgimpwidgets/gimpmemsizeentry.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
---
diff --git a/libgimpwidgets/gimpmemsizeentry.c b/libgimpwidgets/gimpmemsizeentry.c
index 282454b1d8..695e7c5a19 100644
--- a/libgimpwidgets/gimpmemsizeentry.c
+++ b/libgimpwidgets/gimpmemsizeentry.c
@@ -259,12 +259,7 @@ gimp_memsize_entry_set_value (GimpMemsizeEntry *entry,
     }
 
   if (shift != entry->shift)
-    {
-      entry->shift = shift;
-      entry->value = value;
-
-      gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (entry->menu), shift);
-    }
+    gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (entry->menu), shift);
 
 #if _MSC_VER < 1300
 #  define CAST (gint64)


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