diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-08-03 14:55:09 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-09-04 07:38:30 -0700 |
commit | 9a2d503d3b3d2c0a4631ef6c26dcf1c6785a4e56 (patch) | |
tree | 31270a689b6d00666553a0cc71ee9bbb27a70a7a /mobile-widgets/qmlmanager.h | |
parent | 7e2803d6dd65016bfd925345adf3abdfbbbe6056 (diff) | |
download | subsurface-9a2d503d3b3d2c0a4631ef6c26dcf1c6785a4e56.tar.gz |
Unify credential states
Having two different enums around with more or less the same
definition has lead to unclear code. After removing two not needed
states on the mobile end, the remaining step to one enum for the
credential state becomes almost is simple rename operation.
Unfortunately, I do not know a way to embed a plain C enum
from pref.h into the QMLManager object. So after this, there
are still 2 enums around, but now identical.
This commit is not changing any functionality.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'mobile-widgets/qmlmanager.h')
-rw-r--r-- | mobile-widgets/qmlmanager.h | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index fc468baf4..dec9e6502 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -16,7 +16,7 @@ class QMLManager : public QObject { Q_OBJECT - Q_ENUMS(credentialStatus_t) + Q_ENUMS(cloud_status_qml) Q_PROPERTY(QString cloudUserName READ cloudUserName WRITE setCloudUserName NOTIFY cloudUserNameChanged) Q_PROPERTY(QString cloudPassword READ cloudPassword WRITE setCloudPassword NOTIFY cloudPasswordChanged) Q_PROPERTY(QString cloudPin READ cloudPin WRITE setCloudPin NOTIFY cloudPinChanged) @@ -29,8 +29,8 @@ class QMLManager : public QObject { Q_PROPERTY(bool loadFromCloud READ loadFromCloud WRITE setLoadFromCloud NOTIFY loadFromCloudChanged) Q_PROPERTY(QString startPageText READ startPageText WRITE setStartPageText NOTIFY startPageTextChanged) Q_PROPERTY(bool verboseEnabled READ verboseEnabled WRITE setVerboseEnabled NOTIFY verboseEnabledChanged) - Q_PROPERTY(credentialStatus_t credentialStatus READ credentialStatus WRITE setCredentialStatus NOTIFY credentialStatusChanged) - Q_PROPERTY(credentialStatus_t oldStatus READ oldStatus WRITE setOldStatus NOTIFY oldStatusChanged) + Q_PROPERTY(cloud_status_qml credentialStatus READ credentialStatus WRITE setCredentialStatus NOTIFY credentialStatusChanged) + Q_PROPERTY(cloud_status_qml oldStatus READ oldStatus WRITE setOldStatus NOTIFY oldStatusChanged) Q_PROPERTY(QString notificationText READ notificationText WRITE setNotificationText NOTIFY notificationTextChanged) Q_PROPERTY(bool syncToCloud READ syncToCloud WRITE setSyncToCloud NOTIFY syncToCloudChanged) Q_PROPERTY(int updateSelectedDive READ updateSelectedDive WRITE setUpdateSelectedDive NOTIFY updateSelectedDiveChanged) @@ -48,11 +48,12 @@ public: QMLManager(); ~QMLManager(); - enum credentialStatus_t { - UNKNOWN, - INVALID, - VALID, - NOCLOUD + enum cloud_status_qml { + CS_UNKNOWN, + CS_INCORRECT_USER_PASSWD, + CS_NEED_TO_VERIFY, + CS_VERIFIED, + CS_NOCLOUD }; static QMLManager *instance(); @@ -91,11 +92,11 @@ public: QString startPageText() const; void setStartPageText(const QString& text); - credentialStatus_t credentialStatus() const; - void setCredentialStatus(const credentialStatus_t value); + cloud_status_qml credentialStatus() const; + void setCredentialStatus(const cloud_status_qml value); - credentialStatus_t oldStatus() const; - void setOldStatus(const credentialStatus_t value); + cloud_status_qml oldStatus() const; + void setOldStatus(const cloud_status_qml value); QString logText() const; void setLogText(const QString &logText); @@ -207,8 +208,8 @@ private: bool m_syncToCloud; int m_updateSelectedDive; int m_selectedDiveTimestamp; - credentialStatus_t m_credentialStatus; - credentialStatus_t m_oldStatus; + cloud_status_qml m_credentialStatus; + cloud_status_qml m_oldStatus; qreal m_lastDevicePixelRatio; QElapsedTimer timer; bool alreadySaving; |