diff options
author | jan Iversen <jani@apache.org> | 2018-07-18 22:52:13 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-07-25 08:35:04 -0700 |
commit | 92ade62260c30be55632047fa97332b2d2d97a8f (patch) | |
tree | da7b01b2a9928b70337d91e76769a9ad91c3a000 /core/settings/qPrefPrivate.h | |
parent | 3eae683b57d225c680a430c83db1425c38765742 (diff) | |
download | subsurface-92ade62260c30be55632047fa97332b2d2d97a8f.tar.gz |
core: remove LOADSYNC* macros
expend LOADSYNC* into DISK_* macros
remove LOADSYNC* from qPrefPrivate.h
update qPrefDisplay to not use LOADSYNC*
Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/settings/qPrefPrivate.h')
-rw-r--r-- | core/settings/qPrefPrivate.h | 59 |
1 files changed, 15 insertions, 44 deletions
diff --git a/core/settings/qPrefPrivate.h b/core/settings/qPrefPrivate.h index 681627d4f..29cb9028c 100644 --- a/core/settings/qPrefPrivate.h +++ b/core/settings/qPrefPrivate.h @@ -29,8 +29,11 @@ private: qPrefPrivate(QObject *parent = NULL); }; -//****** Macros to be used in the disk functions, which are special ****** -#define LOADSYNC_BOOL(name, field) \ + + +//******* Macros to generate disk function +#define DISK_LOADSYNC_BOOL(usegroup, name, field) \ +void qPref ## usegroup::disk_ ## field(bool doSync) \ { \ if (doSync) \ qPrefPrivate::instance()->setting.setValue(group + name, prefs.field); \ @@ -38,7 +41,8 @@ private: prefs.field = qPrefPrivate::instance()->setting.value(group + name, default_prefs.field).toBool(); \ } -#define LOADSYNC_DOUBLE(name, field) \ +#define DISK_LOADSYNC_DOUBLE(usegroup, name, field) \ +void qPref ## usegroup::disk_ ## field(bool doSync) \ { \ if (doSync) \ qPrefPrivate::instance()->setting.setValue(group + name, prefs.field); \ @@ -46,7 +50,8 @@ private: prefs.field = qPrefPrivate::instance()->setting.value(group + name, default_prefs.field).toDouble(); \ } -#define LOADSYNC_ENUM(name, type, field) \ +#define DISK_LOADSYNC_ENUM(usegroup, name, type, field) \ +void qPref ## usegroup::disk_ ## field(bool doSync) \ { \ if (doSync) \ qPrefPrivate::instance()->setting.setValue(group + name, prefs.field); \ @@ -54,7 +59,8 @@ private: prefs.field = (enum type)qPrefPrivate::instance()->setting.value(group + name, default_prefs.field).toInt(); \ } -#define LOADSYNC_INT(name, field) \ +#define DISK_LOADSYNC_INT(usegroup, name, field) \ +void qPref ## usegroup::disk_ ## field(bool doSync) \ { \ if (doSync) \ qPrefPrivate::instance()->setting.setValue(group + name, prefs.field); \ @@ -62,7 +68,8 @@ private: prefs.field = qPrefPrivate::instance()->setting.value(group + name, default_prefs.field).toInt(); \ } -#define LOADSYNC_INT_DEF(name, field, defval) \ +#define DISK_LOADSYNC_INT_DEF(usegroup, name, field, defval) \ +void qPref ## usegroup::disk_ ## field(bool doSync) \ { \ if (doSync) \ qPrefPrivate::instance()->setting.setValue(group + name, prefs.field); \ @@ -70,7 +77,8 @@ private: prefs.field = qPrefPrivate::instance()->setting.value(group + name, defval).toInt(); \ } -#define LOADSYNC_TXT(name, field) \ +#define DISK_LOADSYNC_TXT(usegroup, name, field) \ +void qPref ## usegroup::disk_ ## field(bool doSync) \ { \ if (doSync) \ qPrefPrivate::instance()->setting.setValue(group + name, prefs.field); \ @@ -78,43 +86,6 @@ private: prefs.field = copy_qstring(qPrefPrivate::instance()->setting.value(group + name, default_prefs.field).toString()); \ } -//******* Macros to generate disk function -#define DISK_LOADSYNC_BOOL(usegroup, name, field) \ -void qPref ## usegroup::disk_ ## field(bool doSync) \ -{ \ - LOADSYNC_BOOL(name, field); \ -} - -#define DISK_LOADSYNC_DOUBLE(usegroup, name, field) \ -void qPref ## usegroup::disk_ ## field(bool doSync) \ -{ \ - LOADSYNC_DOUBLE(name, field); \ -} - -#define DISK_LOADSYNC_ENUM(usegroup, name, type, field) \ -void qPref ## usegroup::disk_ ## field(bool doSync) \ -{ \ - LOADSYNC_ENUM(name, type, field); \ -} - -#define DISK_LOADSYNC_INT(usegroup, name, field) \ -void qPref ## usegroup::disk_ ## field(bool doSync) \ -{ \ - LOADSYNC_INT(name, field); \ -} - -#define DISK_LOADSYNC_INT_DEF(usegroup, name, field, defval) \ -void qPref ## usegroup::disk_ ## field(bool doSync) \ -{ \ - LOADSYNC_INT_DEF(name, field, defval); \ -} - -#define DISK_LOADSYNC_TXT(usegroup, name, field) \ -void qPref ## usegroup::disk_ ## field(bool doSync) \ -{ \ - LOADSYNC_TXT(name, field); \ -} - //******* Macros to generate set function #define SET_PREFERENCE_BOOL(usegroup, field) \ void qPref ## usegroup::set_ ## field (bool value) \ |