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>
This commit is contained in:
jan Iversen 2018-07-05 20:37:53 +02:00 committed by Dirk Hohndel
parent 7103f36c7c
commit 8d66633fe7
14 changed files with 90 additions and 95 deletions

View file

@ -11,10 +11,10 @@
QMLPrefs *QMLPrefs::m_instance = NULL;
QMLPrefs::QMLPrefs() :
m_credentialStatus(QMLPrefs::CS_UNKNOWN),
m_credentialStatus(qPref::CS_UNKNOWN),
m_developer(false),
m_distanceThreshold(1000),
m_oldStatus(QMLPrefs::CS_UNKNOWN),
m_oldStatus(qPref::CS_UNKNOWN),
m_showPin(false),
m_timeThreshold(60)
{
@ -69,16 +69,16 @@ void QMLPrefs::setCloudUserName(const QString &cloudUserName)
emit cloudUserNameChanged();
}
QMLPrefs::cloud_status QMLPrefs::credentialStatus() const
qPref::cloud_status QMLPrefs::credentialStatus() const
{
return m_credentialStatus;
}
void QMLPrefs::setCredentialStatus(const QMLPrefs::cloud_status value)
void QMLPrefs::setCredentialStatus(const qPref::cloud_status value)
{
if (m_credentialStatus != value) {
setOldStatus(m_credentialStatus);
if (value == QMLPrefs::CS_NOCLOUD) {
if (value == qPref::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();
}
QMLPrefs::cloud_status QMLPrefs::oldStatus() const
qPref::cloud_status QMLPrefs::oldStatus() const
{
return m_oldStatus;
}
void QMLPrefs::setOldStatus(const QMLPrefs::cloud_status value)
void QMLPrefs::setOldStatus(const qPref::cloud_status value)
{
if (m_oldStatus != value) {
m_oldStatus = value;
@ -177,7 +177,7 @@ void QMLPrefs::cancelCredentialsPinSetup()
*/
QSettings s;
setCredentialStatus(QMLPrefs::CS_UNKNOWN);
setCredentialStatus(qPref::CS_UNKNOWN);
s.beginGroup("CloudStorage");
s.setValue("email", m_cloudUserName);
s.setValue("password", m_cloudPassword);