From 653a2baf111284171f0a2d25d6d9a0e82979f6d1 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Fri, 14 Sep 2018 12:25:18 +0200 Subject: core/settings: make qPref* constructors private Signed-off-by: Jan Iversen --- core/settings/qPrefCloudStorage.cpp | 4 ---- core/settings/qPrefCloudStorage.h | 3 ++- core/settings/qPrefDisplay.cpp | 4 ---- core/settings/qPrefDisplay.h | 3 ++- core/settings/qPrefDiveComputer.cpp | 4 ---- core/settings/qPrefDiveComputer.h | 3 ++- core/settings/qPrefDivePlanner.cpp | 4 ---- core/settings/qPrefDivePlanner.h | 3 ++- core/settings/qPrefGeneral.cpp | 4 ---- core/settings/qPrefGeneral.h | 3 ++- core/settings/qPrefGeocoding.cpp | 4 ---- core/settings/qPrefGeocoding.h | 3 ++- core/settings/qPrefLanguage.cpp | 4 ---- core/settings/qPrefLanguage.h | 3 ++- core/settings/qPrefLocationService.cpp | 4 ---- core/settings/qPrefLocationService.h | 3 ++- core/settings/qPrefPartialPressureGas.cpp | 4 ---- core/settings/qPrefPartialPressureGas.h | 3 ++- core/settings/qPrefProxy.cpp | 4 ---- core/settings/qPrefProxy.h | 3 ++- core/settings/qPrefTechnicalDetails.cpp | 4 ---- core/settings/qPrefTechnicalDetails.h | 3 ++- core/settings/qPrefUnit.cpp | 4 ---- core/settings/qPrefUnit.h | 3 ++- core/settings/qPrefUpdateManager.cpp | 4 ---- core/settings/qPrefUpdateManager.h | 3 ++- 26 files changed, 26 insertions(+), 65 deletions(-) (limited to 'core') diff --git a/core/settings/qPrefCloudStorage.cpp b/core/settings/qPrefCloudStorage.cpp index 8bbd91aec..26a0787e6 100644 --- a/core/settings/qPrefCloudStorage.cpp +++ b/core/settings/qPrefCloudStorage.cpp @@ -4,10 +4,6 @@ static const QString group = QStringLiteral("CloudStorage"); -qPrefCloudStorage::qPrefCloudStorage(QObject *parent) : QObject(parent) -{ -} - qPrefCloudStorage *qPrefCloudStorage::instance() { static qPrefCloudStorage *self = new qPrefCloudStorage; diff --git a/core/settings/qPrefCloudStorage.h b/core/settings/qPrefCloudStorage.h index 841005b76..2d528fbfb 100644 --- a/core/settings/qPrefCloudStorage.h +++ b/core/settings/qPrefCloudStorage.h @@ -19,7 +19,6 @@ class qPrefCloudStorage : public QObject { Q_PROPERTY(bool save_password_local READ save_password_local WRITE set_save_password_local NOTIFY save_password_localChanged); public: - qPrefCloudStorage(QObject *parent = NULL); static qPrefCloudStorage *instance(); // Load/Sync local settings (disk) and struct preference @@ -71,6 +70,8 @@ signals: void save_password_localChanged(bool value); private: + qPrefCloudStorage() {} + // functions to load/sync variable with disk static void disk_cloud_auto_sync(bool doSync); static void disk_cloud_base_url(bool doSync); diff --git a/core/settings/qPrefDisplay.cpp b/core/settings/qPrefDisplay.cpp index 50ce84a96..d29134d69 100644 --- a/core/settings/qPrefDisplay.cpp +++ b/core/settings/qPrefDisplay.cpp @@ -41,10 +41,6 @@ static const QByteArray st_windowState_default; int qPrefDisplay::st_lastState; static int st_lastState_default = false; -qPrefDisplay::qPrefDisplay(QObject *parent) : QObject(parent) -{ -} - qPrefDisplay *qPrefDisplay::instance() { static qPrefDisplay *self = new qPrefDisplay; diff --git a/core/settings/qPrefDisplay.h b/core/settings/qPrefDisplay.h index b1090b7a1..f5f477972 100644 --- a/core/settings/qPrefDisplay.h +++ b/core/settings/qPrefDisplay.h @@ -27,7 +27,6 @@ class qPrefDisplay : public QObject { Q_PROPERTY(int lastState READ lastState WRITE set_lastState NOTIFY lastStateChanged); public: - qPrefDisplay(QObject *parent = NULL); static qPrefDisplay *instance(); // Load/Sync local settings (disk) and struct preference @@ -93,6 +92,8 @@ signals: void lastStateChanged(int value); private: + qPrefDisplay() {} + // functions to load/sync variable with disk static void disk_animation_speed(bool doSync); static void disk_divelist_font(bool doSync); diff --git a/core/settings/qPrefDiveComputer.cpp b/core/settings/qPrefDiveComputer.cpp index 6e9cc45f1..c19f56c18 100644 --- a/core/settings/qPrefDiveComputer.cpp +++ b/core/settings/qPrefDiveComputer.cpp @@ -4,10 +4,6 @@ static const QString group = QStringLiteral("DiveComputer"); -qPrefDiveComputer::qPrefDiveComputer(QObject *parent) : QObject(parent) -{ -} - qPrefDiveComputer *qPrefDiveComputer::instance() { static qPrefDiveComputer *self = new qPrefDiveComputer; diff --git a/core/settings/qPrefDiveComputer.h b/core/settings/qPrefDiveComputer.h index cb79c7edb..e3cb4df11 100644 --- a/core/settings/qPrefDiveComputer.h +++ b/core/settings/qPrefDiveComputer.h @@ -36,7 +36,6 @@ class qPrefDiveComputer : public QObject { Q_PROPERTY(QString vendor4 READ vendor4 WRITE set_vendor4 NOTIFY vendor4Changed) public: - qPrefDiveComputer(QObject *parent = NULL); static qPrefDiveComputer *instance(); // Load/Sync local settings (disk) and struct preference @@ -101,6 +100,8 @@ signals: void vendor4Changed(const QString &vendor); private: + qPrefDiveComputer() {} + // functions to load/sync variable with disk static void disk_device(bool doSync); diff --git a/core/settings/qPrefDivePlanner.cpp b/core/settings/qPrefDivePlanner.cpp index e094bfed0..a3d4e417e 100644 --- a/core/settings/qPrefDivePlanner.cpp +++ b/core/settings/qPrefDivePlanner.cpp @@ -5,10 +5,6 @@ static const QString group = QStringLiteral("Planner"); -qPrefDivePlanner::qPrefDivePlanner(QObject *parent) : QObject(parent) -{ -} - qPrefDivePlanner *qPrefDivePlanner::instance() { static qPrefDivePlanner *self = new qPrefDivePlanner; diff --git a/core/settings/qPrefDivePlanner.h b/core/settings/qPrefDivePlanner.h index 7a75fa4ce..85b2dbac1 100644 --- a/core/settings/qPrefDivePlanner.h +++ b/core/settings/qPrefDivePlanner.h @@ -36,7 +36,6 @@ class qPrefDivePlanner : public QObject { Q_PROPERTY(bool verbatim_plan READ verbatim_plan WRITE set_verbatim_plan NOTIFY verbatim_planChanged); public: - qPrefDivePlanner(QObject *parent = NULL); static qPrefDivePlanner *instance(); // Load/Sync local settings (disk) and struct preference @@ -135,6 +134,8 @@ signals: void verbatim_planChanged(bool value); private: + qPrefDivePlanner() {} + static void disk_ascratelast6m(bool doSync); static void disk_ascratestops(bool doSync); static void disk_ascrate50(bool doSync); diff --git a/core/settings/qPrefGeneral.cpp b/core/settings/qPrefGeneral.cpp index a04198d7a..766f5edbc 100644 --- a/core/settings/qPrefGeneral.cpp +++ b/core/settings/qPrefGeneral.cpp @@ -11,10 +11,6 @@ static const QString st_diveshareExport_uid_default; bool qPrefGeneral::st_diveshareExport_private; static const bool st_diveshareExport_private_default = false; -qPrefGeneral::qPrefGeneral(QObject *parent) : QObject(parent) -{ -} - qPrefGeneral *qPrefGeneral::instance() { static qPrefGeneral *self = new qPrefGeneral; diff --git a/core/settings/qPrefGeneral.h b/core/settings/qPrefGeneral.h index ec264203b..e851be97d 100644 --- a/core/settings/qPrefGeneral.h +++ b/core/settings/qPrefGeneral.h @@ -26,7 +26,6 @@ class qPrefGeneral : public QObject { public: - qPrefGeneral(QObject *parent = NULL); static qPrefGeneral *instance(); // Load/Sync local settings (disk) and struct preference @@ -90,6 +89,8 @@ signals: void extraEnvironmentalDefaultChanged(bool value); private: + qPrefGeneral() {} + static void disk_auto_recalculate_thumbnails(bool doSync); static void disk_default_cylinder(bool doSync); static void disk_default_filename(bool doSync); diff --git a/core/settings/qPrefGeocoding.cpp b/core/settings/qPrefGeocoding.cpp index 1b1813731..57450eac2 100644 --- a/core/settings/qPrefGeocoding.cpp +++ b/core/settings/qPrefGeocoding.cpp @@ -4,10 +4,6 @@ static const QString group = QStringLiteral("geocoding"); -qPrefGeocoding::qPrefGeocoding(QObject *parent) : QObject(parent) -{ -} - qPrefGeocoding *qPrefGeocoding::instance() { static qPrefGeocoding *self = new qPrefGeocoding; diff --git a/core/settings/qPrefGeocoding.h b/core/settings/qPrefGeocoding.h index a47b534bc..81fc70f58 100644 --- a/core/settings/qPrefGeocoding.h +++ b/core/settings/qPrefGeocoding.h @@ -13,7 +13,6 @@ class qPrefGeocoding : public QObject { Q_PROPERTY(taxonomy_category third_taxonomy_category READ third_taxonomy_category WRITE set_third_taxonomy_category NOTIFY third_taxonomy_categoryChanged); public: - qPrefGeocoding(QObject *parent = NULL); static qPrefGeocoding *instance(); // Load/Sync local settings (disk) and struct preference @@ -37,6 +36,8 @@ signals: void third_taxonomy_categoryChanged(taxonomy_category value); private: + qPrefGeocoding() {} + static void disk_first_taxonomy_category(bool doSync); static void disk_second_taxonomy_category(bool doSync); static void disk_third_taxonomy_category(bool doSync); diff --git a/core/settings/qPrefLanguage.cpp b/core/settings/qPrefLanguage.cpp index 6e8708175..487d04701 100644 --- a/core/settings/qPrefLanguage.cpp +++ b/core/settings/qPrefLanguage.cpp @@ -4,10 +4,6 @@ static const QString group = QStringLiteral("Language"); -qPrefLanguage::qPrefLanguage(QObject *parent) : QObject(parent) -{ -} - qPrefLanguage *qPrefLanguage::instance() { static qPrefLanguage *self = new qPrefLanguage; diff --git a/core/settings/qPrefLanguage.h b/core/settings/qPrefLanguage.h index f3c15823a..a0dfffac8 100644 --- a/core/settings/qPrefLanguage.h +++ b/core/settings/qPrefLanguage.h @@ -17,7 +17,6 @@ class qPrefLanguage : public QObject { Q_PROPERTY(bool use_system_language READ use_system_language WRITE set_use_system_language NOTIFY use_system_languageChanged); public: - qPrefLanguage(QObject *parent = NULL); static qPrefLanguage *instance(); // Load/Sync local settings (disk) and struct preference @@ -56,6 +55,8 @@ signals: void use_system_languageChanged(bool value); private: + qPrefLanguage() {} + static void disk_date_format(bool doSync); static void disk_date_format_override(bool doSync); static void disk_date_format_short(bool doSync); diff --git a/core/settings/qPrefLocationService.cpp b/core/settings/qPrefLocationService.cpp index 716a194c9..786cf58eb 100644 --- a/core/settings/qPrefLocationService.cpp +++ b/core/settings/qPrefLocationService.cpp @@ -4,10 +4,6 @@ static const QString group = QStringLiteral("LocationService"); -qPrefLocationService::qPrefLocationService(QObject *parent) : QObject(parent) -{ -} - qPrefLocationService *qPrefLocationService::instance() { static qPrefLocationService *self = new qPrefLocationService; diff --git a/core/settings/qPrefLocationService.h b/core/settings/qPrefLocationService.h index 6fdca8385..c2c9c8bae 100644 --- a/core/settings/qPrefLocationService.h +++ b/core/settings/qPrefLocationService.h @@ -12,7 +12,6 @@ class qPrefLocationService : public QObject { Q_PROPERTY(int time_threshold READ time_threshold WRITE set_time_threshold NOTIFY time_thresholdChanged); public: - qPrefLocationService(QObject *parent = NULL); static qPrefLocationService *instance(); // Load/Sync local settings (disk) and struct preference @@ -34,6 +33,8 @@ signals: private: + qPrefLocationService() {} + static void disk_distance_threshold(bool doSync); static void disk_time_threshold(bool doSync); }; diff --git a/core/settings/qPrefPartialPressureGas.cpp b/core/settings/qPrefPartialPressureGas.cpp index d7d20952a..f23076cb0 100644 --- a/core/settings/qPrefPartialPressureGas.cpp +++ b/core/settings/qPrefPartialPressureGas.cpp @@ -4,10 +4,6 @@ static const QString group = QStringLiteral("TecDetails"); -qPrefPartialPressureGas::qPrefPartialPressureGas(QObject *parent) : QObject(parent) -{ -} - qPrefPartialPressureGas *qPrefPartialPressureGas::instance() { static qPrefPartialPressureGas *self = new qPrefPartialPressureGas; diff --git a/core/settings/qPrefPartialPressureGas.h b/core/settings/qPrefPartialPressureGas.h index 2f20d980e..7c8df9014 100644 --- a/core/settings/qPrefPartialPressureGas.h +++ b/core/settings/qPrefPartialPressureGas.h @@ -16,7 +16,6 @@ class qPrefPartialPressureGas : public QObject { Q_PROPERTY(double po2_threshold_min READ po2_threshold_min WRITE set_po2_threshold_min NOTIFY po2_threshold_minChanged); public: - qPrefPartialPressureGas(QObject *parent = NULL); static qPrefPartialPressureGas *instance(); // Load/Sync local settings (disk) and struct preference @@ -52,6 +51,8 @@ signals: void po2_threshold_minChanged(double value); private: + qPrefPartialPressureGas() {} + static void disk_phe(bool doSync); static void disk_phe_threshold(bool doSync); static void disk_pn2(bool doSync); diff --git a/core/settings/qPrefProxy.cpp b/core/settings/qPrefProxy.cpp index 4ca02815b..4049c04c5 100644 --- a/core/settings/qPrefProxy.cpp +++ b/core/settings/qPrefProxy.cpp @@ -6,10 +6,6 @@ static const QString group = QStringLiteral("Network"); -qPrefProxy::qPrefProxy(QObject *parent) : QObject(parent) -{ -} - qPrefProxy *qPrefProxy::instance() { static qPrefProxy *self = new qPrefProxy; diff --git a/core/settings/qPrefProxy.h b/core/settings/qPrefProxy.h index 2940c2642..c12c07a2b 100644 --- a/core/settings/qPrefProxy.h +++ b/core/settings/qPrefProxy.h @@ -16,7 +16,6 @@ class qPrefProxy : public QObject { Q_PROPERTY(QString proxy_user READ proxy_user WRITE set_proxy_user NOTIFY proxy_userChanged); public: - qPrefProxy(QObject *parent = NULL); static qPrefProxy *instance(); // Load/Sync local settings (disk) and struct preference @@ -49,6 +48,8 @@ signals: void proxy_userChanged(const QString &value); private: + qPrefProxy() {} + static void disk_proxy_auth(bool doSync); static void disk_proxy_host(bool doSync); static void disk_proxy_pass(bool doSync); diff --git a/core/settings/qPrefTechnicalDetails.cpp b/core/settings/qPrefTechnicalDetails.cpp index 22cea8c74..cfa6cae0e 100644 --- a/core/settings/qPrefTechnicalDetails.cpp +++ b/core/settings/qPrefTechnicalDetails.cpp @@ -5,10 +5,6 @@ static const QString group = QStringLiteral("TecDetails"); -qPrefTechnicalDetails::qPrefTechnicalDetails(QObject *parent) : QObject(parent) -{ -} - qPrefTechnicalDetails *qPrefTechnicalDetails::instance() { static qPrefTechnicalDetails *self = new qPrefTechnicalDetails; diff --git a/core/settings/qPrefTechnicalDetails.h b/core/settings/qPrefTechnicalDetails.h index de439815a..6e6ce8c6d 100644 --- a/core/settings/qPrefTechnicalDetails.h +++ b/core/settings/qPrefTechnicalDetails.h @@ -38,7 +38,6 @@ class qPrefTechnicalDetails : public QObject { Q_PROPERTY(bool zoomed_plot READ zoomed_plot WRITE set_zoomed_plot NOTIFY zoomed_plotChanged); public: - qPrefTechnicalDetails(QObject *parent = NULL); static qPrefTechnicalDetails *instance(); // Load/Sync local settings (disk) and struct preference @@ -137,6 +136,8 @@ signals: void zoomed_plotChanged(bool value); private: + qPrefTechnicalDetails() {} + static void disk_calcalltissues(bool doSync); static void disk_calcceiling(bool doSync); static void disk_calcceiling3m(bool doSync); diff --git a/core/settings/qPrefUnit.cpp b/core/settings/qPrefUnit.cpp index d8e1911eb..6704cb42f 100644 --- a/core/settings/qPrefUnit.cpp +++ b/core/settings/qPrefUnit.cpp @@ -5,10 +5,6 @@ static const QString group = QStringLiteral("Units"); -qPrefUnits::qPrefUnits(QObject *parent) : QObject(parent) -{ -} - qPrefUnits *qPrefUnits::instance() { static qPrefUnits *self = new qPrefUnits; diff --git a/core/settings/qPrefUnit.h b/core/settings/qPrefUnit.h index 737d7814a..0594b4f69 100644 --- a/core/settings/qPrefUnit.h +++ b/core/settings/qPrefUnit.h @@ -20,7 +20,6 @@ class qPrefUnits : public QObject { Q_PROPERTY(units::WEIGHT weight READ weight WRITE set_weight NOTIFY weightChanged); public: - qPrefUnits(QObject *parent = NULL); static qPrefUnits *instance(); // Load/Sync local settings (disk) and struct preference @@ -65,6 +64,8 @@ signals: void weightChanged(int value); private: + qPrefUnits() {} + static void disk_coordinates_traditional(bool doSync); static void disk_duration_units(bool doSync); static void disk_length(bool doSync); diff --git a/core/settings/qPrefUpdateManager.cpp b/core/settings/qPrefUpdateManager.cpp index 4b5fb9e45..34b843d08 100644 --- a/core/settings/qPrefUpdateManager.cpp +++ b/core/settings/qPrefUpdateManager.cpp @@ -8,10 +8,6 @@ static const QString group = QStringLiteral("UpdateManager"); QString qPrefUpdateManager::st_uuidString; static const QString st_uuidString_default; -qPrefUpdateManager::qPrefUpdateManager(QObject *parent) : QObject(parent) -{ -} - qPrefUpdateManager *qPrefUpdateManager::instance() { static qPrefUpdateManager *self = new qPrefUpdateManager; diff --git a/core/settings/qPrefUpdateManager.h b/core/settings/qPrefUpdateManager.h index ee62f0349..609b34fa4 100644 --- a/core/settings/qPrefUpdateManager.h +++ b/core/settings/qPrefUpdateManager.h @@ -15,7 +15,6 @@ class qPrefUpdateManager : public QObject { Q_PROPERTY(const QString uuidString READ uuidString WRITE set_uuidString NOTIFY uuidStringChanged); public: - qPrefUpdateManager(QObject *parent = NULL); static qPrefUpdateManager *instance(); // Load/Sync local settings (disk) and struct preference @@ -45,6 +44,8 @@ signals: void uuidStringChanged(const QString& value); private: + qPrefUpdateManager() {} + static void disk_dont_check_for_updates(bool doSync); static void disk_last_version_used(bool doSync); static void disk_next_check(bool doSync); -- cgit v1.2.3-70-g09d2