mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Location service: make distance and time threshold configurable
Right now the distance is always in meters, the mobile app doesn't deal with units at all, anyway. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
24404a401d
commit
76d0763527
7 changed files with 84 additions and 9 deletions
|
@ -26,6 +26,8 @@ QMLManager::QMLManager() :
|
|||
setCloudPassword(prefs.cloud_storage_password);
|
||||
setSaveCloudPassword(prefs.save_password_local);
|
||||
setSsrfGpsWebUserid(prefs.userid);
|
||||
setDistanceThreshold(prefs.distance_threshold);
|
||||
setTimeThreshold(prefs.time_threshold / 60);
|
||||
if (!same_string(prefs.cloud_storage_email, "") && !same_string(prefs.cloud_storage_password, ""))
|
||||
loadDives();
|
||||
}
|
||||
|
@ -38,6 +40,12 @@ void QMLManager::savePreferences()
|
|||
{
|
||||
QSettings s;
|
||||
s.setValue("subsurface_webservice_uid", ssrfGpsWebUserid());
|
||||
s.beginGroup("LocationService");
|
||||
s.setValue("time_threshold", timeThreshold() * 60);
|
||||
prefs.time_threshold = timeThreshold() * 60;
|
||||
s.setValue("distance_threshold", distanceThreshold());
|
||||
prefs.distance_threshold = distanceThreshold();
|
||||
s.endGroup();
|
||||
s.beginGroup("CloudStorage");
|
||||
s.setValue("email", cloudUserName());
|
||||
s.setValue("save_password_local", saveCloudPassword());
|
||||
|
@ -240,3 +248,25 @@ void QMLManager::setSsrfGpsWebUserid(const QString &userid)
|
|||
m_ssrfGpsWebUserid = userid;
|
||||
emit ssrfGpsWebUseridChanged();
|
||||
}
|
||||
|
||||
int QMLManager::distanceThreshold() const
|
||||
{
|
||||
return m_distanceThreshold;
|
||||
}
|
||||
|
||||
void QMLManager::setDistanceThreshold(int distance)
|
||||
{
|
||||
m_distanceThreshold = distance;
|
||||
emit distanceThresholdChanged();
|
||||
}
|
||||
|
||||
int QMLManager::timeThreshold() const
|
||||
{
|
||||
return m_timeThreshold;
|
||||
}
|
||||
|
||||
void QMLManager::setTimeThreshold(int time)
|
||||
{
|
||||
m_timeThreshold = time;
|
||||
emit timeThresholdChanged();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue