aboutsummaryrefslogtreecommitdiffstats
path: root/core/settings/qPrefDisplay.cpp
AgeCommit message (Collapse)Author
2018-09-25cleanup: do not compare doubles like thisGravatar Jan Mulder
Cleanup another possibly dangerous compare of doubles. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-25qPref: add mobile_scale preferenceGravatar Dirk Hohndel
We use that in the mobile app to scale the whole app, as all sizes there are relative to the default font. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-11core/settings: correct UserSurvey -> userSurvey in qPrefDisplayGravatar jan Iversen
QML is quite special, the variables needs to start with lower case in C++ and are used starting with upper case in QML Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11core/settings: add missing empty line.Gravatar jan Iversen
Standard is to have 1 empty line between functions correct missing static in qPrefGeocoding.h Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11core/setting: change *_changed to *Changed for the sake of QML.Gravatar jan Iversen
QML demands signals to be of the form <name>Changed Changing all of qPref REMARK: this commit is not compileable, since it only change qPref and not the rest of the system Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-07qPref: use helper function to ensure key/name groupingGravatar Dirk Hohndel
We had a couple of instances of names being incorrectly merged with their group, this should handle that better. It's a bit of a big hammer to use, but it seems to work (and it makes it easy to then git grep for cases that don't use the new helper function. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-06qPref: only save settings that aren't the defaultGravatar Dirk Hohndel
This brings us back to the previous behavior. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-30core/settings: add missing load_* call in qPrefDisplayGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25core/tests: merge Animations and add vars. to qPrefDisplayGravatar jan Iversen
Add class variable tooltip_position to qPrefDisplay Add class variable lastDir to qPrefDisplay qPrefDisplay is updated to use new qPrefPrivate functions Adjust test cases incl. qml tests qPrefAnimations only has 1 variable, that really is a display variable Merge the variable into qPrefDisplay, to simplify setup (and avoid loading extra page in qml). correct theme to save in correct place, and make it a static class variable Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25core: make methods in qPrefPrivate staticGravatar jan Iversen
Small cleanup, using static methods is simpler and faster Added propSetValue and propValue instead of exposing setting variable. Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-15core: qPref limit header includesGravatar jan Iversen
replace qPref.h with qPrefFoo.h to limit header includes Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-15core: make methods in qPref* staticGravatar jan Iversen
Make methods static to allow fast and esay access use qPrefXYZ::foo() instead of qPrefXYZ::instance()->foo() Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-26Whitespace cleanup core/settingsGravatar Dirk Hohndel
We can argue about any of the changes here, but they are the result of our whitespace.pl script - so if any of this is offensive to you, part of the resolution will be fixing the script... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-07-25core: remove LOADSYNC* macrosGravatar jan Iversen
expend LOADSYNC* into DISK_* macros remove LOADSYNC* from qPrefPrivate.h update qPrefDisplay to not use LOADSYNC* Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25core: make qPrefDisplay getters static and inlineGravatar jan Iversen
Add static and inline to getter in all qPref header files Remove call to GET_PREFERENCE_* in qPrefDisplay.cpp static inline is slightly faster than a function call, but it saves a lot of coding lines (no lines in qPref*.cpp). Getters are a direct reference to struct preferences, so they will normally only be used from QML. Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25core: qPref replace COPY_TXT with copy_txt in qPrefPrivateGravatar jan Iversen
Add copy_txt function to qPrefPrivate class Remove macro COPY_TXT from qPrefPrivate.h Replace use of COPY_TXT with copy_txt in qPref classes copy_txt is only once, COPY_TXT was expanded approx. 160 times, so this commit saves space (and removes a macro). Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-18core: remove QSettings in qPref* and use a shared variableGravatar jan Iversen
Add qPrefPrivate class which contains one QSettings variable, delete QSettings from qPref* class definitions this secures there are only instance of QSettings (QSettings needs to be in a QObject class to work) Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-15core: qPrefDisplay correct font setting.Gravatar jan Iversen
SettingsObjectWrapper contained some delicate font handling mixing font and font_size, breaking that into 2 parts broke font handling on some platforms Copy font + font_size handling 1-1 from SettingsObjectWrapper Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-12core: move load of display variables to qPrefDisplay from SettingsObjectWrapperGravatar jan Iversen
ensure SettingsObjectWrapper load() loads all display variables. Copy font setting code from SettingsObjectWrapper to qPrefDisplay Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-07core: update qPrefDisplay.cpp to use all qPref macros.Gravatar jan Iversen
change qPrefDisplay.cpp to use qPref_private macros, for each variable. The macros used depend on how standard the variable is handled. Remark: this commit is production code, but qPrefDisplay is NOT integrated into SettingsObjectWrapper and thus not active in the live system Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-07core: copy Display from SettingsObjectWrapper to qPref as its own classGravatar jan Iversen
copy Display from SettingsObjectWrapper to qPref as its own class file. Update Display to use a common load/sync scheme. Update set/get functions to follow common name scheme: - get function have same name as in struct preferences - set function have set_<name in struct preferences> - signal function have <name in struct preferences>_changed one class one .h/.cpp is the C++ idiom. Having load/sync of each variable in 1 functions (in contrast to the distributed way SettingsObjectWrapper handles it) secures the same storage name is used. Having the set/get/load/sync functions grouped together makes it easier to get an overview. REMARK: this commit are made to show the use of the low level LOADSYNC macros, which will be used for special cases. This class is NOT linked into the live system. Signed-off-by: Jan Iversen <jani@apache.org>