From affdc9d39428e5aa50564e3c5cb6a513b7f2a01c Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Tue, 31 Jul 2018 18:40:59 +0200 Subject: core: activate qPrefUnits remove Units from SettingsObjectWrapper and reference qPrefUnits update files using SettingsObjectWrapper/Units to use qPrefUnits this activated qPrefUnits and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen --- core/subsurface-qt/SettingsObjectWrapper.h | 57 ++---------------------------- 1 file changed, 2 insertions(+), 55 deletions(-) (limited to 'core/subsurface-qt/SettingsObjectWrapper.h') diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h index 5afcfccc4..9099b0ceb 100644 --- a/core/subsurface-qt/SettingsObjectWrapper.h +++ b/core/subsurface-qt/SettingsObjectWrapper.h @@ -343,59 +343,6 @@ private: const QString group = QStringLiteral("Planner"); }; -class UnitsSettings : public QObject { - Q_OBJECT - Q_PROPERTY(int length READ length WRITE setLength NOTIFY lengthChanged) - Q_PROPERTY(int pressure READ pressure WRITE setPressure NOTIFY pressureChanged) - Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged) - Q_PROPERTY(int temperature READ temperature WRITE setTemperature NOTIFY temperatureChanged) - Q_PROPERTY(int weight READ weight WRITE setWeight NOTIFY weightChanged) - Q_PROPERTY(QString unit_system READ unitSystem WRITE setUnitSystem NOTIFY unitSystemChanged) - Q_PROPERTY(bool coordinates_traditional READ coordinatesTraditional WRITE setCoordinatesTraditional NOTIFY coordinatesTraditionalChanged) - Q_PROPERTY(int vertical_speed_time READ verticalSpeedTime WRITE setVerticalSpeedTime NOTIFY verticalSpeedTimeChanged) - Q_PROPERTY(int duration_units READ durationUnits WRITE setDurationUnits NOTIFY durationUnitChanged) - Q_PROPERTY(bool show_units_table READ showUnitsTable WRITE setShowUnitsTable NOTIFY showUnitsTableChanged) - -public: - UnitsSettings(QObject *parent = 0); - int length() const; - int pressure() const; - int volume() const; - int temperature() const; - int weight() const; - int verticalSpeedTime() const; - int durationUnits() const; - bool showUnitsTable() const; - QString unitSystem() const; - bool coordinatesTraditional() const; - -public slots: - void setLength(int value); - void setPressure(int value); - void setVolume(int value); - void setTemperature(int value); - void setWeight(int value); - void setVerticalSpeedTime(int value); - void setDurationUnits(int value); - void setShowUnitsTable(bool value); - void setUnitSystem(const QString& value); - void setCoordinatesTraditional(bool value); - -signals: - void lengthChanged(int value); - void pressureChanged(int value); - void volumeChanged(int value); - void temperatureChanged(int value); - void weightChanged(int value); - void verticalSpeedTimeChanged(int value); - void unitSystemChanged(const QString& value); - void coordinatesTraditionalChanged(bool value); - void durationUnitChanged(int value); - void showUnitsTableChanged(bool value); -private: - const QString group = QStringLiteral("Units"); -}; - class GeneralSettingsObjectWrapper : public QObject { Q_OBJECT Q_PROPERTY(QString default_filename READ defaultFilename WRITE setDefaultFilename NOTIFY defaultFilenameChanged) @@ -526,7 +473,7 @@ class SettingsObjectWrapper : public QObject { Q_PROPERTY(qPrefProxy* proxy MEMBER proxy CONSTANT) Q_PROPERTY(qPrefCloudStorage* cloud_storage MEMBER cloud_storage CONSTANT) Q_PROPERTY(DivePlannerSettings* planner MEMBER planner_settings CONSTANT) - Q_PROPERTY(UnitsSettings* units MEMBER unit_settings CONSTANT) + Q_PROPERTY(qPrefUnits* units MEMBER unit_settings CONSTANT) Q_PROPERTY(GeneralSettingsObjectWrapper* general MEMBER general_settings CONSTANT) Q_PROPERTY(qPrefDisplay* display MEMBER display_settings CONSTANT) @@ -546,7 +493,7 @@ public: qPrefProxy *proxy; qPrefCloudStorage *cloud_storage; DivePlannerSettings *planner_settings; - UnitsSettings *unit_settings; + qPrefUnits *unit_settings; GeneralSettingsObjectWrapper *general_settings; qPrefDisplay *display_settings; LanguageSettingsObjectWrapper *language_settings; -- cgit v1.2.3-70-g09d2