mobile-widgets: solve cloudstatus register problem

Use Q_ENUM instad of Q_ENUMS (which is depreciated) since it does the
meta registration for all Qt platforms.

Q_ENUM require the enum to be defined in the class and cannot refer to
a global class, therefore copied enum to class.

This commit is made to get the release to work, with minimal changes,
this class will be moved to qPref and the double definition solved

Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
jan Iversen 2018-07-05 09:46:07 +02:00 committed by Dirk Hohndel
parent 5fc2e0f80f
commit 19803ab3c3
3 changed files with 39 additions and 31 deletions

View file

@ -11,10 +11,10 @@
QMLPrefs *QMLPrefs::m_instance = NULL;
QMLPrefs::QMLPrefs() :
m_credentialStatus(CS_UNKNOWN),
m_credentialStatus(QMLPrefs::CS_UNKNOWN),
m_developer(false),
m_distanceThreshold(1000),
m_oldStatus(CS_UNKNOWN),
m_oldStatus(QMLPrefs::CS_UNKNOWN),
m_showPin(false),
m_timeThreshold(60)
{
@ -69,16 +69,16 @@ void QMLPrefs::setCloudUserName(const QString &cloudUserName)
emit cloudUserNameChanged();
}
cloud_status QMLPrefs::credentialStatus() const
QMLPrefs::cloud_status QMLPrefs::credentialStatus() const
{
return m_credentialStatus;
}
void QMLPrefs::setCredentialStatus(const cloud_status value)
void QMLPrefs::setCredentialStatus(const QMLPrefs::cloud_status value)
{
if (m_credentialStatus != value) {
setOldStatus(m_credentialStatus);
if (value == CS_NOCLOUD) {
if (value == QMLPrefs::CS_NOCLOUD) {
QMLManager::instance()->appendTextToLog("Switching to no cloud mode");
set_filename(NOCLOUD_LOCALSTORAGE);
clearCredentials();
@ -105,12 +105,12 @@ void QMLPrefs::setDistanceThreshold(int distance)
emit distanceThresholdChanged();
}
cloud_status QMLPrefs::oldStatus() const
QMLPrefs::cloud_status QMLPrefs::oldStatus() const
{
return m_oldStatus;
}
void QMLPrefs::setOldStatus(const cloud_status value)
void QMLPrefs::setOldStatus(const QMLPrefs::cloud_status value)
{
if (m_oldStatus != value) {
m_oldStatus = value;
@ -177,7 +177,7 @@ void QMLPrefs::cancelCredentialsPinSetup()
*/
QSettings s;
setCredentialStatus(CS_UNKNOWN);
setCredentialStatus(QMLPrefs::CS_UNKNOWN);
s.beginGroup("CloudStorage");
s.setValue("email", m_cloudUserName);
s.setValue("password", m_cloudPassword);