summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-09-12 13:40:59 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-12 20:18:32 -0700
commit51bc41b5179ff12bf2767cd568dbf8266b72ca7e (patch)
tree1243626fa9ec7a1b7046625e3f24f837441785d6 /mobile-widgets
parent504e9125126cb24467ee8e038a461d731672c4b9 (diff)
downloadsubsurface-51bc41b5179ff12bf2767cd568dbf8266b72ca7e.tar.gz
mobile-widgets: remove setTimeThreshold from system
Use qPrefLocationService::set_time_threshold and remove from qmlprefs.cpp and qmlmanager.cpp Remark: mobile UI shows time in minutes, while it is stored (and calculated) in seconds. Therefore a /60 when reading and *60 when setting. Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qml/Settings.qml5
-rw-r--r--mobile-widgets/qmlmanager.cpp6
-rw-r--r--mobile-widgets/qmlmanager.h1
-rw-r--r--mobile-widgets/qmlprefs.cpp15
-rw-r--r--mobile-widgets/qmlprefs.h10
5 files changed, 3 insertions, 34 deletions
diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml
index 22ff97056..68562a871 100644
--- a/mobile-widgets/qml/Settings.qml
+++ b/mobile-widgets/qml/Settings.qml
@@ -293,11 +293,10 @@ Kirigami.ScrollablePage {
Controls.TextField {
id: timeThreshold
- text: prefs.timeThreshold
+ text: PrefLocationService.time_threshold / 60
Layout.preferredWidth: gridWidth * 0.25
onEditingFinished: {
- prefs.timeThreshold = timeThreshold.text
- manager.savePreferences()
+ PrefLocationService.time_threshold = timeThreshold.text * 60
}
}
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 36108d848..c2b993b0c 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -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()->setTimeThreshold(qPrefLocationService::time_threshold() / 60);
}
QMLManager::~QMLManager()
@@ -423,11 +422,6 @@ QMLManager *QMLManager::instance()
return m_instance;
}
-void QMLManager::savePreferences()
-{
- qPrefLocationService::set_time_threshold(QMLPrefs::instance()->timeThreshold() * 60);
-}
-
#define CLOUDURL QString(prefs.cloud_base_url)
#define CLOUDREDIRECTURL CLOUDURL + "/cgi-bin/redirect.pl"
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index 4b96621ba..b8f44d820 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -146,7 +146,6 @@ public:
public slots:
void appInitialized();
void applicationStateChanged(Qt::ApplicationState state);
- void savePreferences();
void saveCloudCredentials();
void tryRetrieveDataFromBackend();
void handleError(QNetworkReply::NetworkError nError);
diff --git a/mobile-widgets/qmlprefs.cpp b/mobile-widgets/qmlprefs.cpp
index 5220c9c2a..3d5a10f4e 100644
--- a/mobile-widgets/qmlprefs.cpp
+++ b/mobile-widgets/qmlprefs.cpp
@@ -12,8 +12,7 @@ QMLPrefs *QMLPrefs::m_instance = NULL;
QMLPrefs::QMLPrefs() :
m_credentialStatus(qPrefCloudStorage::CS_UNKNOWN),
m_oldStatus(qPrefCloudStorage::CS_UNKNOWN),
- m_showPin(false),
- m_timeThreshold(60)
+ m_showPin(false)
{
// This strange construct is needed because QMLEngine calls new and that
// cannot be overwritten
@@ -109,18 +108,6 @@ void QMLPrefs::setShowPin(bool enable)
emit showPinChanged();
}
-int QMLPrefs::timeThreshold() const
-{
- return m_timeThreshold;
-}
-
-void QMLPrefs::setTimeThreshold(int time)
-{
- m_timeThreshold = time;
- GpsLocation::instance()->setGpsTimeThreshold(m_timeThreshold * 60);
- emit timeThresholdChanged();
-}
-
const QString QMLPrefs::theme() const
{
return qPrefDisplay::theme();
diff --git a/mobile-widgets/qmlprefs.h b/mobile-widgets/qmlprefs.h
index 4127d9b79..f1d6dea50 100644
--- a/mobile-widgets/qmlprefs.h
+++ b/mobile-widgets/qmlprefs.h
@@ -37,11 +37,6 @@ class QMLPrefs : public QObject {
READ theme
WRITE setTheme
NOTIFY themeChanged)
- Q_PROPERTY(int timeThreshold
- MEMBER m_timeThreshold
- WRITE setTimeThreshold
- NOTIFY timeThresholdChanged)
-
public:
QMLPrefs();
~QMLPrefs();
@@ -66,9 +61,6 @@ public:
bool showPin() const;
void setShowPin(bool enable);
- int timeThreshold() const;
- void setTimeThreshold(int time);
-
const QString theme() const;
void setTheme(QString theme);
@@ -84,7 +76,6 @@ private:
static QMLPrefs *m_instance;
qPrefCloudStorage::cloud_status m_oldStatus;
bool m_showPin;
- int m_timeThreshold;
signals:
void cloudPasswordChanged();
@@ -94,7 +85,6 @@ signals:
void oldStatusChanged();
void showPinChanged();
void themeChanged();
- void timeThresholdChanged();
};
#endif