diff options
author | jan Iversen <jani@apache.org> | 2018-08-15 11:50:53 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-08-15 16:11:39 -0700 |
commit | 6aee600aa7022dd8f0453c658c967d5268c611b3 (patch) | |
tree | 6c3547dc39c59d4cd79eb72adb45bc3e3760a58f /desktop-widgets/preferences/preferences_graph.cpp | |
parent | 3b84dbe554a76e2f024b7254c079c761429223ac (diff) | |
download | subsurface-6aee600aa7022dd8f0453c658c967d5268c611b3.tar.gz |
desktop-widgets/preferences: reemove SettingsObjectWrapper
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 'desktop-widgets/preferences/preferences_graph.cpp')
-rw-r--r-- | desktop-widgets/preferences/preferences_graph.cpp | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/desktop-widgets/preferences/preferences_graph.cpp b/desktop-widgets/preferences/preferences_graph.cpp index cbb2b2c39..29b749b4e 100644 --- a/desktop-widgets/preferences/preferences_graph.cpp +++ b/desktop-widgets/preferences/preferences_graph.cpp @@ -1,7 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 #include "preferences_graph.h" #include "ui_preferences_graph.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefGeneral.h" +#include "core/settings/qPrefTechnicalDetails.h" +#include "core/settings/qPrefPartialPressureGas.h" #include <QMessageBox> #include "qt-models/models.h" @@ -52,32 +54,29 @@ void PreferencesGraph::refreshSettings() void PreferencesGraph::syncSettings() { - auto general = qPrefGeneral::instance(); - general->set_defaultsetpoint(lrint(ui->defaultSetpoint->value() * 1000.0)); - general->set_o2consumption(lrint(ui->psro2rate->value() *1000.0)); - general->set_pscr_ratio(lrint(1000.0 / ui->pscrfactor->value())); - general->set_auto_recalculate_thumbnails(ui->auto_recalculate_thumbnails->isChecked()); + qPrefGeneral::set_defaultsetpoint(lrint(ui->defaultSetpoint->value() * 1000.0)); + qPrefGeneral::set_o2consumption(lrint(ui->psro2rate->value() *1000.0)); + qPrefGeneral::set_pscr_ratio(lrint(1000.0 / ui->pscrfactor->value())); + qPrefGeneral::set_auto_recalculate_thumbnails(ui->auto_recalculate_thumbnails->isChecked()); - auto pp_gas = qPrefPartialPressureGas::instance(); - pp_gas->set_phe_threshold(ui->pheThreshold->value()); - pp_gas->set_po2_threshold_max(ui->po2ThresholdMax->value()); - pp_gas->set_po2_threshold_min(ui->po2ThresholdMin->value()); - pp_gas->set_pn2_threshold(ui->pn2Threshold->value()); + qPrefPartialPressureGas::set_phe_threshold(ui->pheThreshold->value()); + qPrefPartialPressureGas::set_po2_threshold_max(ui->po2ThresholdMax->value()); + qPrefPartialPressureGas::set_po2_threshold_min(ui->po2ThresholdMin->value()); + qPrefPartialPressureGas::set_pn2_threshold(ui->pn2Threshold->value()); - auto tech = qPrefTechnicalDetails::instance(); - tech->set_modpO2(ui->maxpo2->value()); - tech->set_redceiling(ui->red_ceiling->isChecked()); + qPrefTechnicalDetails::set_modpO2(ui->maxpo2->value()); + qPrefTechnicalDetails::set_redceiling(ui->red_ceiling->isChecked()); prefs.planner_deco_mode = ui->buehlmann->isChecked() ? BUEHLMANN : VPMB; - tech->set_gflow(ui->gflow->value()); - tech->set_gfhigh(ui->gfhigh->value()); - tech->set_vpmb_conservatism(ui->vpmb_conservatism->value()); - tech->set_show_ccr_setpoint(ui->show_ccr_setpoint->isChecked()); - tech->set_show_ccr_sensors(ui->show_ccr_sensors->isChecked()); - tech->set_show_scr_ocpo2(ui->show_scr_ocpo2->isChecked()); - tech->set_display_unused_tanks(ui->display_unused_tanks->isChecked()); - tech->set_show_average_depth(ui->show_average_depth->isChecked()); - tech->set_show_icd(ui->show_icd->isChecked()); - tech->set_display_deco_mode(ui->vpmb->isChecked() ? VPMB : BUEHLMANN); + qPrefTechnicalDetails::set_gflow(ui->gflow->value()); + qPrefTechnicalDetails::set_gfhigh(ui->gfhigh->value()); + qPrefTechnicalDetails::set_vpmb_conservatism(ui->vpmb_conservatism->value()); + qPrefTechnicalDetails::set_show_ccr_setpoint(ui->show_ccr_setpoint->isChecked()); + qPrefTechnicalDetails::set_show_ccr_sensors(ui->show_ccr_sensors->isChecked()); + qPrefTechnicalDetails::set_show_scr_ocpo2(ui->show_scr_ocpo2->isChecked()); + qPrefTechnicalDetails::set_display_unused_tanks(ui->display_unused_tanks->isChecked()); + qPrefTechnicalDetails::set_show_average_depth(ui->show_average_depth->isChecked()); + qPrefTechnicalDetails::set_show_icd(ui->show_icd->isChecked()); + qPrefTechnicalDetails::set_display_deco_mode(ui->vpmb->isChecked() ? VPMB : BUEHLMANN); } #define DANGER_GF (gf > 100) ? "* { color: red; }" : "" |