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 {
|
||||
id: distanceThreshold
|
||||
text: prefs.distanceThreshold
|
||||
text: PrefLocationService.distance_threshold
|
||||
Layout.preferredWidth: gridWidth * 0.25
|
||||
onEditingFinished: {
|
||||
prefs.distanceThreshold = distanceThreshold.text
|
||||
manager.savePreferences()
|
||||
PrefLocationService.distance_threshold = distanceThreshold.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -406,7 +406,6 @@ void QMLManager::finishSetup()
|
|||
appendTextToLog(tr("no cloud credentials"));
|
||||
setStartPageText(RED_FONT + tr("Please enter valid cloud credentials.") + END_FONT);
|
||||
}
|
||||
QMLPrefs::instance()->setDistanceThreshold(qPrefLocationService::distance_threshold());
|
||||
QMLPrefs::instance()->setTimeThreshold(qPrefLocationService::time_threshold() / 60);
|
||||
}
|
||||
|
||||
|
@ -427,7 +426,6 @@ QMLManager *QMLManager::instance()
|
|||
void QMLManager::savePreferences()
|
||||
{
|
||||
qPrefLocationService::set_time_threshold(QMLPrefs::instance()->timeThreshold() * 60);
|
||||
qPrefLocationService::set_distance_threshold(QMLPrefs::instance()->distanceThreshold());
|
||||
}
|
||||
|
||||
#define CLOUDURL QString(prefs.cloud_base_url)
|
||||
|
|
|
@ -11,7 +11,6 @@ QMLPrefs *QMLPrefs::m_instance = NULL;
|
|||
|
||||
QMLPrefs::QMLPrefs() :
|
||||
m_credentialStatus(qPrefCloudStorage::CS_UNKNOWN),
|
||||
m_distanceThreshold(1000),
|
||||
m_oldStatus(qPrefCloudStorage::CS_UNKNOWN),
|
||||
m_showPin(false),
|
||||
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
|
||||
{
|
||||
return m_oldStatus;
|
||||
|
|
|
@ -25,10 +25,6 @@ class QMLPrefs : public QObject {
|
|||
MEMBER m_credentialStatus
|
||||
WRITE setCredentialStatus
|
||||
NOTIFY credentialStatusChanged)
|
||||
Q_PROPERTY(int distanceThreshold
|
||||
MEMBER m_distanceThreshold
|
||||
WRITE setDistanceThreshold
|
||||
NOTIFY distanceThresholdChanged)
|
||||
Q_PROPERTY(bool showPin
|
||||
MEMBER m_showPin
|
||||
WRITE setShowPin
|
||||
|
@ -64,9 +60,6 @@ public:
|
|||
qPrefCloudStorage::cloud_status credentialStatus() const;
|
||||
void setCredentialStatus(const qPrefCloudStorage::cloud_status value);
|
||||
|
||||
int distanceThreshold() const;
|
||||
void setDistanceThreshold(int distance);
|
||||
|
||||
qPrefCloudStorage::cloud_status oldStatus() const;
|
||||
void setOldStatus(const qPrefCloudStorage::cloud_status value);
|
||||
|
||||
|
@ -88,7 +81,6 @@ private:
|
|||
QString m_cloudPin;
|
||||
QString m_cloudUserName;
|
||||
qPrefCloudStorage::cloud_status m_credentialStatus;
|
||||
int m_distanceThreshold;
|
||||
static QMLPrefs *m_instance;
|
||||
qPrefCloudStorage::cloud_status m_oldStatus;
|
||||
bool m_showPin;
|
||||
|
@ -99,7 +91,6 @@ signals:
|
|||
void cloudPinChanged();
|
||||
void cloudUserNameChanged();
|
||||
void credentialStatusChanged();
|
||||
void distanceThresholdChanged();
|
||||
void oldStatusChanged();
|
||||
void showPinChanged();
|
||||
void themeChanged();
|
||||
|
|
Loading…
Add table
Reference in a new issue