core: remove location service preferences

Including the related tests.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2021-09-11 17:01:16 -07:00
parent 6f813b9f8e
commit 2a0d14b100
13 changed files with 0 additions and 301 deletions

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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());

View file

@ -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);

View file

@ -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