diff options
author | jan Iversen <jani@apache.org> | 2018-07-12 10:25:28 +0200 |
---|---|---|
committer | jan Iversen <jani@apache.org> | 2018-07-12 22:34:35 +0200 |
commit | d4e76dac9e8dbbb784c7133a4cc918de3121f35c (patch) | |
tree | 84fb28a19e62e03232a1c3fb82daed35201da9a4 /core/subsurface-qt | |
parent | 3a314c3dec7e3f383dec458f5edd150f3df87b9d (diff) | |
download | subsurface-d4e76dac9e8dbbb784c7133a4cc918de3121f35c.tar.gz |
core: remove Animations from SettingsObjectWrapper and activate qPrefAnimations
remove Animations from SettingsObjectWrapper and reference qPrefAnimations
update files using SettingsObjectWrapper/Animations to user qPrefAnimations
this activated qPrefAnimations
Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/subsurface-qt')
-rw-r--r-- | core/subsurface-qt/SettingsObjectWrapper.cpp | 23 | ||||
-rw-r--r-- | core/subsurface-qt/SettingsObjectWrapper.h | 21 |
2 files changed, 3 insertions, 41 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp index c5a335a8e..e2fadd90c 100644 --- a/core/subsurface-qt/SettingsObjectWrapper.cpp +++ b/core/subsurface-qt/SettingsObjectWrapper.cpp @@ -2054,27 +2054,6 @@ void LanguageSettingsObjectWrapper::setDateFormatOverride(bool value) emit dateFormatOverrideChanged(value); } -AnimationsSettingsObjectWrapper::AnimationsSettingsObjectWrapper(QObject* parent): - QObject(parent) -{ -} - -int AnimationsSettingsObjectWrapper::animationSpeed() const -{ - return prefs.animation_speed; -} - -void AnimationsSettingsObjectWrapper::setAnimationSpeed(int value) -{ - if (value == prefs.animation_speed) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("animation_speed", value); - prefs.animation_speed = value; - emit animationSpeedChanged(value); -} LocationServiceSettingsObjectWrapper::LocationServiceSettingsObjectWrapper(QObject* parent): QObject(parent) @@ -2127,7 +2106,7 @@ QObject(parent), general_settings(new GeneralSettingsObjectWrapper(this)), display_settings(new qPrefDisplay(this)), language_settings(new LanguageSettingsObjectWrapper(this)), - animation_settings(new AnimationsSettingsObjectWrapper(this)), + animation_settings(new qPrefAnimations(this)), location_settings(new LocationServiceSettingsObjectWrapper(this)), update_manager_settings(new UpdateManagerSettings(this)), dive_computer_settings(new DiveComputerSettings(this)) diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h index a6a47a0a1..075227384 100644 --- a/core/subsurface-qt/SettingsObjectWrapper.h +++ b/core/subsurface-qt/SettingsObjectWrapper.h @@ -640,23 +640,6 @@ private: const QString group = QStringLiteral("Language"); }; -class AnimationsSettingsObjectWrapper : public QObject { - Q_OBJECT - Q_PROPERTY(int animation_speed READ animationSpeed WRITE setAnimationSpeed NOTIFY animationSpeedChanged) -public: - AnimationsSettingsObjectWrapper(QObject *parent); - int animationSpeed() const; - -public slots: - void setAnimationSpeed(int value); - -signals: - void animationSpeedChanged(int value); - -private: - const QString group = QStringLiteral("Animations"); -}; - class LocationServiceSettingsObjectWrapper : public QObject { Q_OBJECT Q_PROPERTY(int time_threshold READ timeThreshold WRITE setTimeThreshold NOTIFY timeThresholdChanged) @@ -690,7 +673,7 @@ class SettingsObjectWrapper : public QObject { Q_PROPERTY(GeneralSettingsObjectWrapper* general MEMBER general_settings CONSTANT) Q_PROPERTY(qPrefDisplay* display MEMBER display_settings CONSTANT) Q_PROPERTY(LanguageSettingsObjectWrapper* language MEMBER language_settings CONSTANT) - Q_PROPERTY(AnimationsSettingsObjectWrapper* animation MEMBER animation_settings CONSTANT) + Q_PROPERTY(qPrefAnimations* animation MEMBER animation_settings CONSTANT) Q_PROPERTY(LocationServiceSettingsObjectWrapper* Location MEMBER location_settings CONSTANT) Q_PROPERTY(UpdateManagerSettings* update MEMBER update_manager_settings CONSTANT) @@ -709,7 +692,7 @@ public: GeneralSettingsObjectWrapper *general_settings; qPrefDisplay *display_settings; LanguageSettingsObjectWrapper *language_settings; - AnimationsSettingsObjectWrapper *animation_settings; + qPrefAnimations *animation_settings; LocationServiceSettingsObjectWrapper *location_settings; UpdateManagerSettings *update_manager_settings; DiveComputerSettings *dive_computer_settings; |