aboutsummaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt/SettingsObjectWrapper.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-07-22 16:19:22 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-25 08:35:04 -0700
commit3d6848b22c9fb64a99bb3dec535431a6cab09ad9 (patch)
treec1a7aedcf02120c9ea0031194b1cef2d15db97fe /core/subsurface-qt/SettingsObjectWrapper.cpp
parent98820cf970335523b4cd2a84a025c12b5480e0aa (diff)
downloadsubsurface-3d6848b22c9fb64a99bb3dec535431a6cab09ad9.tar.gz
core: activate qPrefDiveComputer
remove DiveComputer from SettingsObjectWrapper and reference qPrefDiveComputer update files using SettingsObjectWrapper/DiveComputer to use qPrefDiveComputer this activated qPrefDiveComputer and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/subsurface-qt/SettingsObjectWrapper.cpp')
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.cpp99
1 files changed, 2 insertions, 97 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index 9020143d2..9e0e8992c 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -9,95 +9,6 @@
#include "core/qthelper.h"
#include "core/prefs-macros.h"
-DiveComputerSettings::DiveComputerSettings(QObject *parent):
- QObject(parent)
-{
-}
-
-QString DiveComputerSettings::dc_vendor() const
-{
- return prefs.dive_computer.vendor;
-}
-
-QString DiveComputerSettings::dc_product() const
-{
- return prefs.dive_computer.product;
-}
-
-QString DiveComputerSettings::dc_device() const
-{
- return prefs.dive_computer.device;
-}
-
-QString DiveComputerSettings::dc_device_name() const
-{
- return prefs.dive_computer.device_name;
-}
-
-int DiveComputerSettings::downloadMode() const
-{
- return prefs.dive_computer.download_mode;
-}
-
-void DiveComputerSettings::setVendor(const QString& vendor)
-{
- if (vendor == prefs.dive_computer.vendor)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("dive_computer_vendor", vendor);
- free((void *)prefs.dive_computer.vendor);
- prefs.dive_computer.vendor = copy_qstring(vendor);
-}
-
-void DiveComputerSettings::setProduct(const QString& product)
-{
- if (product == prefs.dive_computer.product)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("dive_computer_product", product);
- free((void *)prefs.dive_computer.product);
- prefs.dive_computer.product = copy_qstring(product);
-}
-
-void DiveComputerSettings::setDevice(const QString& device)
-{
- if (device == prefs.dive_computer.device)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("dive_computer_device", device);
- free((void *)prefs.dive_computer.device);
- prefs.dive_computer.device = copy_qstring(device);
-}
-
-void DiveComputerSettings::setDeviceName(const QString& device_name)
-{
- if (device_name == prefs.dive_computer.device_name)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("dive_computer_device_name", device_name);
- free((void *)prefs.dive_computer.device_name);
- prefs.dive_computer.device_name = copy_qstring(device_name);
-}
-
-void DiveComputerSettings::setDownloadMode(int mode)
-{
- if (mode == prefs.dive_computer.download_mode)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("dive_computer_download_mode", mode);
- prefs.dive_computer.download_mode = mode;
-}
-
UpdateManagerSettings::UpdateManagerSettings(QObject *parent) : QObject(parent)
{
@@ -1930,7 +1841,7 @@ QObject(parent),
animation_settings(new qPrefAnimations(this)),
location_settings(new LocationServiceSettingsObjectWrapper(this)),
update_manager_settings(new UpdateManagerSettings(this)),
- dive_computer_settings(new DiveComputerSettings(this))
+ dive_computer_settings(new qPrefDiveComputer(this))
{
}
@@ -2077,13 +1988,7 @@ void SettingsObjectWrapper::load()
prefs.planner_deco_mode = deco_mode(s.value("deco_mode", default_prefs.planner_deco_mode).toInt());
s.endGroup();
- s.beginGroup("DiveComputer");
- GET_TXT("dive_computer_vendor",dive_computer.vendor);
- GET_TXT("dive_computer_product", dive_computer.product);
- GET_TXT("dive_computer_device", dive_computer.device);
- GET_TXT("dive_computer_device_name", dive_computer.device_name);
- GET_INT("dive_computer_download_mode", dive_computer.download_mode);
- s.endGroup();
+ qPrefDiveComputer::instance()->load();
s.beginGroup("UpdateManager");
prefs.update_manager.dont_check_exists = s.contains("DontCheckForUpdates");