From 93c19b18a7fe8e4204a12f3ff99aff6135c5558e Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 8 Aug 2016 10:34:48 -0300 Subject: Settings update: Fix "geocoding" Use the SettingsObjectWrapper to access "geocoding" Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- .../preferences/preferences_georeference.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'desktop-widgets/preferences/preferences_georeference.cpp') diff --git a/desktop-widgets/preferences/preferences_georeference.cpp b/desktop-widgets/preferences/preferences_georeference.cpp index 8446d0e9a..f626b3141 100644 --- a/desktop-widgets/preferences/preferences_georeference.cpp +++ b/desktop-widgets/preferences/preferences_georeference.cpp @@ -2,6 +2,7 @@ #include "ui_prefs_georeference.h" #include "core/prefs-macros.h" #include "core/qthelper.h" +#include "core/subsurface-qt/SettingsObjectWrapper.h" #include "qt-models/divelocationmodel.h" #include @@ -33,13 +34,11 @@ void PreferencesGeoreference::refreshSettings() void PreferencesGeoreference::syncSettings() { - QSettings s; - s.beginGroup("geocoding"); - s.setValue("enable_geocoding", ui->enable_geocoding->isChecked()); - s.setValue("parse_dives_without_gps", ui->parse_without_gps->isChecked()); - s.setValue("tag_existing_dives", ui->tag_existing_dives->isChecked()); - s.setValue("cat0", ui->first_item->currentIndex()); - s.setValue("cat1", ui->second_item->currentIndex()); - s.setValue("cat2", ui->third_item->currentIndex()); - s.endGroup(); + auto geocoding = SettingsObjectWrapper::instance()->geocoding; + geocoding->setEnableGeocoding(ui->enable_geocoding->isChecked()); + geocoding->setParseDiveWithoutGps(ui->parse_without_gps->isChecked()); + geocoding->setTagExistingDives(ui->tag_existing_dives->isChecked()); + geocoding->setFirstTaxonomyCategory((taxonomy_category) ui->first_item->currentIndex()); + geocoding->setSecondTaxonomyCategory((taxonomy_category) ui->second_item->currentIndex()); + geocoding->setThirdTaxonomyCategory((taxonomy_category) ui->third_item->currentIndex()); } -- cgit v1.2.3-70-g09d2