[gimp] libgimpwidgets: fix setting GimpMemSizeEntry value with unit change.



commit 0be4e5c1dcf6b8719319c67b7dd8115860208439
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.

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


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