diff options
author | jan Iversen <jani@apache.org> | 2018-07-05 20:37:53 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-07-10 10:30:50 -0700 |
commit | 8d66633fe798f6c45978ea1b0d47aa04625d4ac5 (patch) | |
tree | 1a6b63b6720f52f3263fa371e6c9f95ccfacf3e7 /core | |
parent | 7103f36c7c9ed0117a9f600cee6b2565d98a6638 (diff) | |
download | subsurface-8d66633fe798f6c45978ea1b0d47aa04625d4ac5.tar.gz |
core: make qPref::cloud_status the only version of the enum
add enum to qPref and remove elsewhere
update source core to reference qPref.
the enum cannot be in pref.h because it is to be used in qml and Q_ENUM
need the enum to be defined as part of the class
Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/cloudstorage.cpp | 6 | ||||
-rw-r--r-- | core/pref.h | 8 | ||||
-rw-r--r-- | core/settings/qPref.h | 8 |
3 files changed, 11 insertions, 11 deletions
diff --git a/core/cloudstorage.cpp b/core/cloudstorage.cpp index 68b81fbbf..8c4da4791 100644 --- a/core/cloudstorage.cpp +++ b/core/cloudstorage.cpp @@ -52,7 +52,7 @@ void CloudStorageAuthenticate::uploadFinished() CloudStorageSettings csSettings(parent()); if (cloudAuthReply == QLatin1String("[VERIFIED]") || cloudAuthReply == QLatin1String("[OK]")) { - csSettings.setVerificationStatus(CS_VERIFIED); + csSettings.setVerificationStatus(qPref::CS_VERIFIED); /* TODO: Move this to a correct place NotificationWidget *nw = MainWindow::instance()->getNotificationWidget(); if (nw->getNotificationText() == myLastError) @@ -61,7 +61,7 @@ void CloudStorageAuthenticate::uploadFinished() myLastError.clear(); } else if (cloudAuthReply == QLatin1String("[VERIFY]") || cloudAuthReply == QLatin1String("Invalid PIN")) { - csSettings.setVerificationStatus(CS_NEED_TO_VERIFY); + csSettings.setVerificationStatus(qPref::CS_NEED_TO_VERIFY); report_error(qPrintable(tr("Cloud account verification required, enter PIN in preferences"))); } else if (cloudAuthReply == QLatin1String("[PASSWDCHANGED]")) { free((void *)prefs.cloud_storage_password); @@ -70,7 +70,7 @@ void CloudStorageAuthenticate::uploadFinished() emit passwordChangeSuccessful(); return; } else { - csSettings.setVerificationStatus(CS_INCORRECT_USER_PASSWD); + csSettings.setVerificationStatus(qPref::CS_INCORRECT_USER_PASSWD); myLastError = cloudAuthReply; report_error("%s", qPrintable(cloudAuthReply)); } diff --git a/core/pref.h b/core/pref.h index fb84856a4..bae7992fe 100644 --- a/core/pref.h +++ b/core/pref.h @@ -213,14 +213,6 @@ enum def_file_behavior { CLOUD_DEFAULT_FILE }; -enum cloud_status { - CS_UNKNOWN, - CS_INCORRECT_USER_PASSWD, - CS_NEED_TO_VERIFY, - CS_VERIFIED, - CS_NOCLOUD -}; - extern struct preferences prefs, default_prefs, git_prefs; extern const char *system_divelist_default_font; diff --git a/core/settings/qPref.h b/core/settings/qPref.h index 002f66608..44dc6e075 100644 --- a/core/settings/qPref.h +++ b/core/settings/qPref.h @@ -20,6 +20,14 @@ public: void loadSync(bool doSync); public: + enum cloud_status { + CS_UNKNOWN, + CS_INCORRECT_USER_PASSWD, + CS_NEED_TO_VERIFY, + CS_VERIFIED, + CS_NOCLOUD + }; + private: }; |