mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
7103f36c7c
commit
8d66633fe7
14 changed files with 90 additions and 95 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue