diff options
Diffstat (limited to 'core/prefs-macros.h')
-rw-r--r-- | core/prefs-macros.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/prefs-macros.h b/core/prefs-macros.h index bd1fc9a33..9208fb82e 100644 --- a/core/prefs-macros.h +++ b/core/prefs-macros.h @@ -11,6 +11,13 @@ else \ prefs.units.field = default_prefs.units.field +#define GET_UNIT3(name, field, f, l, type) \ + v = s.value(QString(name)); \ + if (v.isValid() && v.toInt() >= (f) && v.toInt() <= (l)) \ + prefs.units.field = (type)v.toInt(); \ + else \ + prefs.units.field = default_prefs.units.field + #define GET_BOOL(name, field) \ v = s.value(QString(name)); \ if (v.isValid()) \ |