core/settings: make qPref* constructors private

Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
jan Iversen 2018-09-14 12:25:18 +02:00 committed by Dirk Hohndel
parent 6e846eb4c0
commit 653a2baf11
26 changed files with 26 additions and 65 deletions

View file

@ -4,10 +4,6 @@
static const QString group = QStringLiteral("CloudStorage");
qPrefCloudStorage::qPrefCloudStorage(QObject *parent) : QObject(parent)
{
}
qPrefCloudStorage *qPrefCloudStorage::instance()
{
static qPrefCloudStorage *self = new qPrefCloudStorage;

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -4,10 +4,6 @@
static const QString group = QStringLiteral("DiveComputer");
qPrefDiveComputer::qPrefDiveComputer(QObject *parent) : QObject(parent)
{
}
qPrefDiveComputer *qPrefDiveComputer::instance()
{
static qPrefDiveComputer *self = new qPrefDiveComputer;

View file

@ -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);

View file

@ -5,10 +5,6 @@
static const QString group = QStringLiteral("Planner");
qPrefDivePlanner::qPrefDivePlanner(QObject *parent) : QObject(parent)
{
}
qPrefDivePlanner *qPrefDivePlanner::instance()
{
static qPrefDivePlanner *self = new qPrefDivePlanner;

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -4,10 +4,6 @@
static const QString group = QStringLiteral("geocoding");
qPrefGeocoding::qPrefGeocoding(QObject *parent) : QObject(parent)
{
}
qPrefGeocoding *qPrefGeocoding::instance()
{
static qPrefGeocoding *self = new qPrefGeocoding;

View file

@ -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);

View file

@ -4,10 +4,6 @@
static const QString group = QStringLiteral("Language");
qPrefLanguage::qPrefLanguage(QObject *parent) : QObject(parent)
{
}
qPrefLanguage *qPrefLanguage::instance()
{
static qPrefLanguage *self = new qPrefLanguage;

View file

@ -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);

View file

@ -4,10 +4,6 @@
static const QString group = QStringLiteral("LocationService");
qPrefLocationService::qPrefLocationService(QObject *parent) : QObject(parent)
{
}
qPrefLocationService *qPrefLocationService::instance()
{
static qPrefLocationService *self = new qPrefLocationService;

View file

@ -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);
};

View file

@ -4,10 +4,6 @@
static const QString group = QStringLiteral("TecDetails");
qPrefPartialPressureGas::qPrefPartialPressureGas(QObject *parent) : QObject(parent)
{
}
qPrefPartialPressureGas *qPrefPartialPressureGas::instance()
{
static qPrefPartialPressureGas *self = new qPrefPartialPressureGas;

View file

@ -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);

View file

@ -6,10 +6,6 @@
static const QString group = QStringLiteral("Network");
qPrefProxy::qPrefProxy(QObject *parent) : QObject(parent)
{
}
qPrefProxy *qPrefProxy::instance()
{
static qPrefProxy *self = new qPrefProxy;

View file

@ -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);

View file

@ -5,10 +5,6 @@
static const QString group = QStringLiteral("TecDetails");
qPrefTechnicalDetails::qPrefTechnicalDetails(QObject *parent) : QObject(parent)
{
}
qPrefTechnicalDetails *qPrefTechnicalDetails::instance()
{
static qPrefTechnicalDetails *self = new qPrefTechnicalDetails;

View file

@ -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);

View file

@ -5,10 +5,6 @@
static const QString group = QStringLiteral("Units");
qPrefUnits::qPrefUnits(QObject *parent) : QObject(parent)
{
}
qPrefUnits *qPrefUnits::instance()
{
static qPrefUnits *self = new qPrefUnits;

View file

@ -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);

View file

@ -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;

View file

@ -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);