From f7ab2be17373631eec5e596a2f8457d2757d9167 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Tue, 1 Nov 2022 17:13:30 +0100 Subject: [PATCH] Unimportant changes Signals were made non-references for debugging, but that shouldn't actually matter since Qt copies the parameters anyway. --- libraries/shared/src/SettingInterface.h | 4 ++-- libraries/shared/src/SettingManager.cpp | 7 ++++--- libraries/shared/src/SettingManager.h | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/libraries/shared/src/SettingInterface.h b/libraries/shared/src/SettingInterface.h index fa30b24e08..2503fdbcdd 100644 --- a/libraries/shared/src/SettingInterface.h +++ b/libraries/shared/src/SettingInterface.h @@ -28,11 +28,11 @@ namespace Setting { class Interface { public: const QString& getKey() const { return _key; } - bool isSet() const { return _isSet; } + bool isSet() const { return _isSet; } virtual void setVariant(const QVariant& variant) = 0; virtual QVariant getVariant() = 0; - + protected: Interface(const QString& key) : _key(key) {} virtual ~Interface() = default; diff --git a/libraries/shared/src/SettingManager.cpp b/libraries/shared/src/SettingManager.cpp index 9bf6429ce7..9276a93f08 100644 --- a/libraries/shared/src/SettingManager.cpp +++ b/libraries/shared/src/SettingManager.cpp @@ -29,13 +29,14 @@ namespace Setting { init(); } - void WriteWorker::setValue(const QString &key, const QVariant &value) { - //qDebug() << "Setting config " << key << "to" << value; + void WriteWorker::setValue(const QString key, const QVariant value) { + //qCDebug(settings_writer) << "Setting config " << key << "to" << value; + init(); _qSettings->setValue(key, value); } - void WriteWorker::removeKey(const QString &key) { + void WriteWorker::removeKey(const QString key) { init(); _qSettings->remove(key); } diff --git a/libraries/shared/src/SettingManager.h b/libraries/shared/src/SettingManager.h index 2b62842028..726331eea4 100644 --- a/libraries/shared/src/SettingManager.h +++ b/libraries/shared/src/SettingManager.h @@ -65,14 +65,14 @@ namespace Setting { * @param key Configuration key * @param value Configuration value */ - void setValue(const QString &key, const QVariant &value); + void setValue(const QString key, const QVariant value); /** * @brief Remove a value from the configuration * * @param key Key to remove */ - void removeKey(const QString &key); + void removeKey(const QString key); /** * @brief Force writing the config to disk @@ -191,8 +191,8 @@ namespace Setting { void terminateThread(); signals: - void valueChanged(const QString &key, const QVariant &value); - void keyRemoved(const QString &key); + void valueChanged(const QString key, QVariant value); + void keyRemoved(const QString key); void syncRequested(); private: