mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile-widgets: move distanceThreshold handling to qPref
Remove distanceThreshold from qmlprefs and use qPref instead update qml no user experience change Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c454f6954f
commit
baa828e900
4 changed files with 2 additions and 26 deletions
|
@ -278,11 +278,10 @@ Kirigami.ScrollablePage {
|
||||||
|
|
||||||
Controls.TextField {
|
Controls.TextField {
|
||||||
id: distanceThreshold
|
id: distanceThreshold
|
||||||
text: prefs.distanceThreshold
|
text: PrefLocationService.distance_threshold
|
||||||
Layout.preferredWidth: gridWidth * 0.25
|
Layout.preferredWidth: gridWidth * 0.25
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
prefs.distanceThreshold = distanceThreshold.text
|
PrefLocationService.distance_threshold = distanceThreshold.text
|
||||||
manager.savePreferences()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -406,7 +406,6 @@ void QMLManager::finishSetup()
|
||||||
appendTextToLog(tr("no cloud credentials"));
|
appendTextToLog(tr("no cloud credentials"));
|
||||||
setStartPageText(RED_FONT + tr("Please enter valid cloud credentials.") + END_FONT);
|
setStartPageText(RED_FONT + tr("Please enter valid cloud credentials.") + END_FONT);
|
||||||
}
|
}
|
||||||
QMLPrefs::instance()->setDistanceThreshold(qPrefLocationService::distance_threshold());
|
|
||||||
QMLPrefs::instance()->setTimeThreshold(qPrefLocationService::time_threshold() / 60);
|
QMLPrefs::instance()->setTimeThreshold(qPrefLocationService::time_threshold() / 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -427,7 +426,6 @@ QMLManager *QMLManager::instance()
|
||||||
void QMLManager::savePreferences()
|
void QMLManager::savePreferences()
|
||||||
{
|
{
|
||||||
qPrefLocationService::set_time_threshold(QMLPrefs::instance()->timeThreshold() * 60);
|
qPrefLocationService::set_time_threshold(QMLPrefs::instance()->timeThreshold() * 60);
|
||||||
qPrefLocationService::set_distance_threshold(QMLPrefs::instance()->distanceThreshold());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CLOUDURL QString(prefs.cloud_base_url)
|
#define CLOUDURL QString(prefs.cloud_base_url)
|
||||||
|
|
|
@ -11,7 +11,6 @@ QMLPrefs *QMLPrefs::m_instance = NULL;
|
||||||
|
|
||||||
QMLPrefs::QMLPrefs() :
|
QMLPrefs::QMLPrefs() :
|
||||||
m_credentialStatus(qPrefCloudStorage::CS_UNKNOWN),
|
m_credentialStatus(qPrefCloudStorage::CS_UNKNOWN),
|
||||||
m_distanceThreshold(1000),
|
|
||||||
m_oldStatus(qPrefCloudStorage::CS_UNKNOWN),
|
m_oldStatus(qPrefCloudStorage::CS_UNKNOWN),
|
||||||
m_showPin(false),
|
m_showPin(false),
|
||||||
m_timeThreshold(60)
|
m_timeThreshold(60)
|
||||||
|
@ -86,17 +85,6 @@ void QMLPrefs::setCredentialStatus(const qPrefCloudStorage::cloud_status value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int QMLPrefs::distanceThreshold() const
|
|
||||||
{
|
|
||||||
return m_distanceThreshold;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QMLPrefs::setDistanceThreshold(int distance)
|
|
||||||
{
|
|
||||||
m_distanceThreshold = distance;
|
|
||||||
emit distanceThresholdChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
qPrefCloudStorage::cloud_status QMLPrefs::oldStatus() const
|
qPrefCloudStorage::cloud_status QMLPrefs::oldStatus() const
|
||||||
{
|
{
|
||||||
return m_oldStatus;
|
return m_oldStatus;
|
||||||
|
|
|
@ -25,10 +25,6 @@ class QMLPrefs : public QObject {
|
||||||
MEMBER m_credentialStatus
|
MEMBER m_credentialStatus
|
||||||
WRITE setCredentialStatus
|
WRITE setCredentialStatus
|
||||||
NOTIFY credentialStatusChanged)
|
NOTIFY credentialStatusChanged)
|
||||||
Q_PROPERTY(int distanceThreshold
|
|
||||||
MEMBER m_distanceThreshold
|
|
||||||
WRITE setDistanceThreshold
|
|
||||||
NOTIFY distanceThresholdChanged)
|
|
||||||
Q_PROPERTY(bool showPin
|
Q_PROPERTY(bool showPin
|
||||||
MEMBER m_showPin
|
MEMBER m_showPin
|
||||||
WRITE setShowPin
|
WRITE setShowPin
|
||||||
|
@ -64,9 +60,6 @@ public:
|
||||||
qPrefCloudStorage::cloud_status credentialStatus() const;
|
qPrefCloudStorage::cloud_status credentialStatus() const;
|
||||||
void setCredentialStatus(const qPrefCloudStorage::cloud_status value);
|
void setCredentialStatus(const qPrefCloudStorage::cloud_status value);
|
||||||
|
|
||||||
int distanceThreshold() const;
|
|
||||||
void setDistanceThreshold(int distance);
|
|
||||||
|
|
||||||
qPrefCloudStorage::cloud_status oldStatus() const;
|
qPrefCloudStorage::cloud_status oldStatus() const;
|
||||||
void setOldStatus(const qPrefCloudStorage::cloud_status value);
|
void setOldStatus(const qPrefCloudStorage::cloud_status value);
|
||||||
|
|
||||||
|
@ -88,7 +81,6 @@ private:
|
||||||
QString m_cloudPin;
|
QString m_cloudPin;
|
||||||
QString m_cloudUserName;
|
QString m_cloudUserName;
|
||||||
qPrefCloudStorage::cloud_status m_credentialStatus;
|
qPrefCloudStorage::cloud_status m_credentialStatus;
|
||||||
int m_distanceThreshold;
|
|
||||||
static QMLPrefs *m_instance;
|
static QMLPrefs *m_instance;
|
||||||
qPrefCloudStorage::cloud_status m_oldStatus;
|
qPrefCloudStorage::cloud_status m_oldStatus;
|
||||||
bool m_showPin;
|
bool m_showPin;
|
||||||
|
@ -99,7 +91,6 @@ signals:
|
||||||
void cloudPinChanged();
|
void cloudPinChanged();
|
||||||
void cloudUserNameChanged();
|
void cloudUserNameChanged();
|
||||||
void credentialStatusChanged();
|
void credentialStatusChanged();
|
||||||
void distanceThresholdChanged();
|
|
||||||
void oldStatusChanged();
|
void oldStatusChanged();
|
||||||
void showPinChanged();
|
void showPinChanged();
|
||||||
void themeChanged();
|
void themeChanged();
|
||||||
|
|
Loading…
Add table
Reference in a new issue