From 81d5d82b7bfb1a7a1cfe44b8d33befe9b31a2099 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 10 Aug 2016 13:27:03 -0300 Subject: Settings update: Clean up save user id local So, prefs.save_userid_local is being set outside of a preferences set (it's set to true and false while loading the files via xml or git) and because of that I had to bypass a few method calls. When something triggers a preferences change, the application will be notified that the preferences changed, thing that I couldn't do while reading the xml or git because that should be local-only. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- core/subsurface-qt/SettingsObjectWrapper.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'core/subsurface-qt/SettingsObjectWrapper.h') diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h index c1fd8a7ef..157c7432c 100644 --- a/core/subsurface-qt/SettingsObjectWrapper.h +++ b/core/subsurface-qt/SettingsObjectWrapper.h @@ -262,6 +262,7 @@ class CloudStorageSettings : public QObject { Q_PROPERTY(QString userid READ userId WRITE setUserId NOTIFY userIdChanged) Q_PROPERTY(QString base_url READ baseUrl WRITE setBaseUrl NOTIFY baseUrlChanged) Q_PROPERTY(QString git_url READ gitUrl WRITE setGitUrl NOTIFY gitUrlChanged) + Q_PROPERTY(short save_userid_local READ saveUserIdLocal WRITE setSaveUserIdLocal NOTIFY saveUserIdLocalChanged) Q_PROPERTY(bool git_local_only READ gitLocalOnly WRITE setGitLocalOnly NOTIFY gitLocalOnlyChanged) Q_PROPERTY(bool save_password_local READ savePasswordLocal WRITE setSavePasswordLocal NOTIFY savePasswordLocalChanged) Q_PROPERTY(short verification_status READ verificationStatus WRITE setVerificationStatus NOTIFY verificationStatusChanged) @@ -279,6 +280,7 @@ public: short verificationStatus() const; bool backgroundSync() const; bool gitLocalOnly() const; + short saveUserIdLocal() const; public slots: void setPassword(const QString& value); @@ -292,6 +294,7 @@ public slots: void setVerificationStatus(short value); void setBackgroundSync(bool value); void setGitLocalOnly(bool value); + void setSaveUserIdLocal(short value); signals: void passwordChanged(const QString& value); @@ -305,6 +308,8 @@ signals: void verificationStatusChanged(short value); void backgroundSyncChanged(bool value); void gitLocalOnlyChanged(bool value); + void saveUserIdLocalChanged(short value); + private: QString group; }; @@ -601,7 +606,6 @@ private: class SettingsObjectWrapper : public QObject { Q_OBJECT - Q_PROPERTY(short save_userid_local READ saveUserIdLocal WRITE setSaveUserIdLocal NOTIFY saveUserIdLocalChanged) Q_PROPERTY(TechnicalDetailsSettings* techical_details MEMBER techDetails CONSTANT) Q_PROPERTY(PartialPressureGasSettings* pp_gas MEMBER pp_gas CONSTANT) @@ -619,7 +623,6 @@ class SettingsObjectWrapper : public QObject { Q_PROPERTY(LocationServiceSettingsObjectWrapper* Location MEMBER location_settings CONSTANT) public: static SettingsObjectWrapper *instance(); - short saveUserIdLocal() const; TechnicalDetailsSettings *techDetails; PartialPressureGasSettings *pp_gas; @@ -635,12 +638,8 @@ public: AnimationsSettingsObjectWrapper *animation_settings; LocationServiceSettingsObjectWrapper *location_settings; -public slots: - void setSaveUserIdLocal(short value); private: SettingsObjectWrapper(QObject *parent = NULL); -signals: - void saveUserIdLocalChanged(short value); }; #endif -- cgit v1.2.3-70-g09d2