diff --git a/backend-shared/plannershared.cpp b/backend-shared/plannershared.cpp index d35c1e676..a83a3bd56 100644 --- a/backend-shared/plannershared.cpp +++ b/backend-shared/plannershared.cpp @@ -6,12 +6,6 @@ #include "qt-models/diveplannermodel.h" #include "qt-models/cylindermodel.h" -plannerShared *plannerShared::instance() -{ - static plannerShared *self = new plannerShared; - return self; -} - // Planning values deco_mode plannerShared::planner_deco_mode() { diff --git a/backend-shared/plannershared.h b/backend-shared/plannershared.h index 39acf98db..d3e9f9fe4 100644 --- a/backend-shared/plannershared.h +++ b/backend-shared/plannershared.h @@ -16,8 +16,6 @@ class plannerShared: public QObject { Q_OBJECT public: - static plannerShared *instance(); - // Planning data static deco_mode planner_deco_mode(); static int reserve_gas(); @@ -53,9 +51,6 @@ public slots: static void set_bottompo2(double value); static void set_decopo2(double value); static void set_bestmixend(int value); - -private: - plannerShared() {} }; #endif // PLANNERSHARED_H diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp index 70aaa22e0..eeb59e880 100644 --- a/desktop-widgets/diveplanner.cpp +++ b/desktop-widgets/diveplanner.cpp @@ -466,7 +466,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) connect(ui.display_runtime, &QAbstractButton::toggled, plannerModel, &DivePlannerPointsModel::setDisplayRuntime); connect(ui.display_transitions, &QAbstractButton::toggled, plannerModel, &DivePlannerPointsModel::setDisplayTransitions); connect(ui.safetystop, &QAbstractButton::toggled, plannerModel, &DivePlannerPointsModel::setSafetyStop); - connect(ui.reserve_gas, QOverload::of(&QSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_reserve_gas); + connect(ui.reserve_gas, QOverload::of(&QSpinBox::valueChanged), &plannerShared::set_reserve_gas); connect(ui.ascRate75, QOverload::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscrate75Display); connect(ui.ascRate50, QOverload::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscrate50Display); connect(ui.ascRateStops, QOverload::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscratestopsDisplay); @@ -477,11 +477,11 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) connect(ui.gflow, QOverload::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setGFLow); connect(ui.vpmb_conservatism, QOverload::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setVpmbConservatism); connect(ui.backgasBreaks, &QAbstractButton::toggled, this, &PlannerSettingsWidget::setBackgasBreaks); - connect(ui.bailout, &QAbstractButton::toggled, plannerShared::instance(), &plannerShared::set_dobailout); - connect(ui.o2narcotic, &QAbstractButton::toggled, plannerShared::instance(), &plannerShared::set_o2narcotic); + connect(ui.bailout, &QAbstractButton::toggled, &plannerShared::set_dobailout); + connect(ui.o2narcotic, &QAbstractButton::toggled, &plannerShared::set_o2narcotic); connect(ui.switch_at_req_stop, &QAbstractButton::toggled, plannerModel, &DivePlannerPointsModel::setSwitchAtReqStop); - connect(ui.min_switch_duration, QOverload::of(&QSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_min_switch_duration); - connect(ui.surface_segment, QOverload::of(&QSpinBox::valueChanged), plannerShared::instance(), plannerShared::set_surface_segment); + connect(ui.min_switch_duration, QOverload::of(&QSpinBox::valueChanged), &plannerShared::set_min_switch_duration); + connect(ui.surface_segment, QOverload::of(&QSpinBox::valueChanged), &plannerShared::set_surface_segment); connect(ui.rebreathermode, QOverload::of(&QComboBox::currentIndexChanged), plannerModel, &DivePlannerPointsModel::setRebreatherMode); connect(ui.rebreathermode, QOverload::of(&QComboBox::currentIndexChanged), this, &PlannerSettingsWidget::setBailoutVisibility); @@ -489,13 +489,13 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) connect(ui.buehlmann_deco, &QAbstractButton::clicked, [=] { disableDecoElements(BUEHLMANN); }); connect(ui.vpmb_deco, &QAbstractButton::clicked, [=] { disableDecoElements(VPMB); }); - connect(ui.sacfactor, QOverload::of(&QDoubleSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_sacfactor); + connect(ui.sacfactor, QOverload::of(&QDoubleSpinBox::valueChanged), &plannerShared::set_sacfactor); connect(ui.problemsolvingtime, QOverload::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setProblemSolvingTime); - connect(ui.bottompo2, QOverload::of(&QDoubleSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_bottompo2); - connect(ui.decopo2, QOverload::of(&QDoubleSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_decopo2); - connect(ui.bestmixEND, QOverload::of(&QSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_bestmixend); - connect(ui.bottomSAC, QOverload::of(&QDoubleSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_bottomsac); - connect(ui.decoStopSAC, QOverload::of(&QDoubleSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_decosac); + connect(ui.bottompo2, QOverload::of(&QDoubleSpinBox::valueChanged), &plannerShared::set_bottompo2); + connect(ui.decopo2, QOverload::of(&QDoubleSpinBox::valueChanged), &plannerShared::set_decopo2); + connect(ui.bestmixEND, QOverload::of(&QSpinBox::valueChanged), &plannerShared::set_bestmixend); + connect(ui.bottomSAC, QOverload::of(&QDoubleSpinBox::valueChanged), &plannerShared::set_bottomsac); + connect(ui.decoStopSAC, QOverload::of(&QDoubleSpinBox::valueChanged), &plannerShared::set_decosac); settingsChanged(); ui.gflow->setValue(prefs.gflow); diff --git a/tests/testplannershared.cpp b/tests/testplannershared.cpp index da4de48fb..d3de0526d 100644 --- a/tests/testplannershared.cpp +++ b/tests/testplannershared.cpp @@ -12,7 +12,6 @@ void TestPlannerShared::initTestCase() QCoreApplication::setOrganizationName("Subsurface"); QCoreApplication::setOrganizationDomain("subsurface.hohndel.org"); QCoreApplication::setApplicationName("SubsurfaceTestPlannerShared"); - plannerShared::instance(); }