summaryrefslogtreecommitdiffstats
path: root/core/divecomputer.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-08-15 11:54:37 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-15 16:11:39 -0700
commit4b2071728dd450e8fa9b81d4ccd3a1d80d78a305 (patch)
tree0c127d89f59a52a42171f043dc091e2a434f1601 /core/divecomputer.cpp
parent94fd7586072e019a89b648cf885e0dcb266ba076 (diff)
downloadsubsurface-4b2071728dd450e8fa9b81d4ccd3a1d80d78a305.tar.gz
core: remove SettingsObjectWrapper and update qPref calls
remove use of SettingsObjectWrapper:: remove include of SettingsObjectWrapper.h use qPrefFoo:: for setters and getters replace prefs.foo with qPrefXYZ::foo() where feasible (this expands to the same code, but gives us more control over the variable). Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/divecomputer.cpp')
-rw-r--r--core/divecomputer.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/divecomputer.cpp b/core/divecomputer.cpp
index 978074e62..5e177e541 100644
--- a/core/divecomputer.cpp
+++ b/core/divecomputer.cpp
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include "divecomputer.h"
#include "dive.h"
-#include "subsurface-qt/SettingsObjectWrapper.h"
+#include "core/settings/qPrefDiveComputer.h"
#include "subsurface-string.h"
DiveComputerList dcList;
@@ -123,14 +123,12 @@ extern "C" void call_for_each_dc (void *f, void (*callback)(void *, const char *
extern "C" int is_default_dive_computer(const char *vendor, const char *product)
{
- auto dc = SettingsObjectWrapper::instance()->dive_computer_settings;
- return dc->vendor() == vendor && dc->product() == product;
+ return qPrefDiveComputer::vendor() == vendor && qPrefDiveComputer::product() == product;
}
extern "C" int is_default_dive_computer_device(const char *name)
{
- auto dc = SettingsObjectWrapper::instance()->dive_computer_settings;
- return dc->device() == name;
+ return qPrefDiveComputer::device() == name;
}
extern "C" void set_dc_nickname(struct dive *dive)