From 684e334fb6098e604a91d140c1e2ea0883dff081 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Sun, 2 Sep 2018 16:22:16 +0200 Subject: core: declare cloud_status in qPrefCloudStorage qml declaration of cloud_status (defined in pref.h) does not belong in qPref.h but in qPrefCloudStorage Signed-off-by: Jan Iversen --- core/cloudstorage.cpp | 6 +++--- core/settings/qPref.cpp | 2 +- core/settings/qPref.h | 9 --------- core/settings/qPrefCloudStorage.h | 9 +++++++++ 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'core') diff --git a/core/cloudstorage.cpp b/core/cloudstorage.cpp index 264a7a8a0..001e0acdf 100644 --- a/core/cloudstorage.cpp +++ b/core/cloudstorage.cpp @@ -52,7 +52,7 @@ void CloudStorageAuthenticate::uploadFinished() qPrefCloudStorage csSettings(parent()); if (cloudAuthReply == QLatin1String("[VERIFIED]") || cloudAuthReply == QLatin1String("[OK]")) { - csSettings.set_cloud_verification_status(qPref::CS_VERIFIED); + csSettings.set_cloud_verification_status(qPrefCloudStorage::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.set_cloud_verification_status(qPref::CS_NEED_TO_VERIFY); + csSettings.set_cloud_verification_status(qPrefCloudStorage::CS_NEED_TO_VERIFY); report_error(qPrintable(tr("Cloud account verification required, enter PIN in preferences"))); } else if (cloudAuthReply == QLatin1String("[PASSWDCHANGED]")) { csSettings.set_cloud_storage_password(cloudNewPassword); @@ -69,7 +69,7 @@ void CloudStorageAuthenticate::uploadFinished() emit passwordChangeSuccessful(); return; } else { - csSettings.set_cloud_verification_status(qPref::CS_INCORRECT_USER_PASSWD); + csSettings.set_cloud_verification_status(qPrefCloudStorage::CS_INCORRECT_USER_PASSWD); myLastError = cloudAuthReply; report_error("%s", qPrintable(cloudAuthReply)); } diff --git a/core/settings/qPref.cpp b/core/settings/qPref.cpp index 61561a188..2a455b4fd 100644 --- a/core/settings/qPref.cpp +++ b/core/settings/qPref.cpp @@ -64,7 +64,7 @@ void qPref::registerQML(QQmlEngine *engine) } // Register special types - qmlRegisterUncreatableType("org.subsurfacedivelog.mobile",1,0,"CloudStatus","Enum is not a type"); + qmlRegisterUncreatableType("org.subsurfacedivelog.mobile",1,0,"CloudStatus","Enum is not a type"); qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); diff --git a/core/settings/qPref.h b/core/settings/qPref.h index e42e2b96b..f13a29274 100644 --- a/core/settings/qPref.h +++ b/core/settings/qPref.h @@ -39,15 +39,6 @@ public: void registerQML(QQmlEngine *engine); public: - enum cloud_status { - CS_UNKNOWN, - CS_INCORRECT_USER_PASSWD, - CS_NEED_TO_VERIFY, - CS_VERIFIED, - CS_NOCLOUD - }; - Q_ENUM(cloud_status); - static const QString canonical_version() { return QString(CANONICAL_VERSION_STRING); } static const QString mobile_version() { return QString(MOBILE_VERSION_STRING); } diff --git a/core/settings/qPrefCloudStorage.h b/core/settings/qPrefCloudStorage.h index 0cb4cc03c..631eaa670 100644 --- a/core/settings/qPrefCloudStorage.h +++ b/core/settings/qPrefCloudStorage.h @@ -27,6 +27,15 @@ public: static void sync() { loadSync(true); } public: + enum cloud_status { + CS_UNKNOWN, + CS_INCORRECT_USER_PASSWD, + CS_NEED_TO_VERIFY, + CS_VERIFIED, + CS_NOCLOUD + }; + Q_ENUM(cloud_status); + static QString cloud_base_url() { return prefs.cloud_base_url; } static QString cloud_git_url() { return prefs.cloud_git_url; } static QString cloud_storage_email() { return prefs.cloud_storage_email; } -- cgit v1.2.3-70-g09d2