aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2021-09-11 17:01:16 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-09-13 11:21:34 -0700
commit2a0d14b10065540d7d709950c0005bed459f5e82 (patch)
tree0aed144e712bc68126d9f3eb471f3c449414683b /core
parent6f813b9f8e58a7b6529e3be728e0ae37e8401400 (diff)
downloadsubsurface-2a0d14b10065540d7d709950c0005bed459f5e82.tar.gz
core: remove location service preferences
Including the related tests. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r--core/CMakeLists.txt2
-rw-r--r--core/pref.c2
-rw-r--r--core/pref.h4
-rw-r--r--core/settings/qPref.cpp3
-rw-r--r--core/settings/qPrefLocationService.cpp21
-rw-r--r--core/settings/qPrefLocationService.h42
6 files changed, 0 insertions, 74 deletions
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index fd878c7f3..0e11d62d3 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -221,8 +221,6 @@ set(SUBSURFACE_CORE_LIB_SRCS
settings/qPrefGeocoding.h
settings/qPrefLanguage.cpp
settings/qPrefLanguage.h
- settings/qPrefLocationService.cpp
- settings/qPrefLocationService.h
settings/qPrefLog.cpp
settings/qPrefLog.h
settings/qPrefMedia.cpp
diff --git a/core/pref.c b/core/pref.c
index 6be6fe6ee..75dedcbeb 100644
--- a/core/pref.c
+++ b/core/pref.c
@@ -84,8 +84,6 @@ struct preferences default_prefs = {
},
.planner_deco_mode = BUEHLMANN,
.vpmb_conservatism = 3,
- .distance_threshold = 100,
- .time_threshold = 300,
#if defined(SUBSURFACE_MOBILE)
.cloud_timeout = 10,
#else
diff --git a/core/pref.h b/core/pref.h
index 97590c4dc..a3f9c2b3b 100644
--- a/core/pref.h
+++ b/core/pref.h
@@ -134,10 +134,6 @@ struct preferences {
const char *time_format;
bool time_format_override;
- // ********** LocationService **********
- int time_threshold;
- int distance_threshold;
-
// ********** Network **********
bool proxy_auth;
const char *proxy_host;
diff --git a/core/settings/qPref.cpp b/core/settings/qPref.cpp
index 4254a2dac..4b662fd71 100644
--- a/core/settings/qPref.cpp
+++ b/core/settings/qPref.cpp
@@ -8,7 +8,6 @@
#include "qPrefGeneral.h"
#include "qPrefGeocoding.h"
#include "qPrefLanguage.h"
-#include "qPrefLocationService.h"
#include "qPrefPartialPressureGas.h"
#include "qPrefProxy.h"
#include "qPrefTechnicalDetails.h"
@@ -32,7 +31,6 @@ void qPref::loadSync(bool doSync)
qPrefGeneral::loadSync(doSync);
qPrefGeocoding::loadSync(doSync);
qPrefLanguage::loadSync(doSync);
- qPrefLocationService::loadSync(doSync);
qPrefPartialPressureGas::loadSync(doSync);
qPrefProxy::loadSync(doSync);
qPrefTechnicalDetails::loadSync(doSync);
@@ -67,7 +65,6 @@ void qPref::registerQML(QQmlEngine *engine)
ct->setContextProperty("PrefGeneral", qPrefGeneral::instance());
ct->setContextProperty("PrefGeocoding", qPrefGeocoding::instance());
ct->setContextProperty("PrefLanguage", qPrefLanguage::instance());
- ct->setContextProperty("PrefLocationService", qPrefLocationService::instance());
ct->setContextProperty("PrefPartialPressureGas", qPrefPartialPressureGas::instance());
ct->setContextProperty("PrefProxy", qPrefProxy::instance());
ct->setContextProperty("PrefTechnicalDetails", qPrefTechnicalDetails::instance());
diff --git a/core/settings/qPrefLocationService.cpp b/core/settings/qPrefLocationService.cpp
deleted file mode 100644
index 786cf58eb..000000000
--- a/core/settings/qPrefLocationService.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include "qPrefLocationService.h"
-#include "qPrefPrivate.h"
-
-static const QString group = QStringLiteral("LocationService");
-
-qPrefLocationService *qPrefLocationService::instance()
-{
- static qPrefLocationService *self = new qPrefLocationService;
- return self;
-}
-
-void qPrefLocationService::loadSync(bool doSync)
-{
- disk_distance_threshold(doSync);
- disk_time_threshold(doSync);
-}
-
-HANDLE_PREFERENCE_INT(LocationService, "distance_threshold", distance_threshold);
-
-HANDLE_PREFERENCE_INT(LocationService, "time_threshold", time_threshold);
diff --git a/core/settings/qPrefLocationService.h b/core/settings/qPrefLocationService.h
deleted file mode 100644
index 7a0c724a8..000000000
--- a/core/settings/qPrefLocationService.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#ifndef QPREFLOCATIONSERVICE_H
-#define QPREFLOCATIONSERVICE_H
-#include "core/pref.h"
-
-#include <QObject>
-
-
-class qPrefLocationService : public QObject {
- Q_OBJECT
- Q_PROPERTY(int distance_threshold READ distance_threshold WRITE set_distance_threshold NOTIFY distance_thresholdChanged)
- Q_PROPERTY(int time_threshold READ time_threshold WRITE set_time_threshold NOTIFY time_thresholdChanged)
-
-public:
- static qPrefLocationService *instance();
-
- // Load/Sync local settings (disk) and struct preference
- static void loadSync(bool doSync);
- static void load() { loadSync(false); }
- static void sync() { loadSync(true); }
-
-public:
- static int distance_threshold() { return prefs.distance_threshold; }
- static int time_threshold() { return prefs.time_threshold; }
-
-public slots:
- static void set_distance_threshold(int value);
- static void set_time_threshold(int value);
-
-signals:
- void distance_thresholdChanged(int value);
- void time_thresholdChanged(int value);
-
-
-private:
- qPrefLocationService() {}
-
- static void disk_distance_threshold(bool doSync);
- static void disk_time_threshold(bool doSync);
-};
-
-#endif