summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2020-01-02 14:35:49 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-06 10:34:42 +0900
commite2d568acc147cf7c43e61950a96df652a5bb9234 (patch)
tree68a9ed12639ad7eeca9e9bb40f9c7fe0887d8b78 /desktop-widgets/diveplanner.cpp
parentf1bb2a81cab5056dd77b476f3e7961b712e74d00 (diff)
downloadsubsurface-e2d568acc147cf7c43e61950a96df652a5bb9234.tar.gz
desktop-widgets: replace QSignalMapper for set_deco_mode
QSignalMapper had a parameter convert problem, when mapping to set_deco_mode in plannerShared. Use lambda function in connect to avoid parameter convert problem. Signed-off-by: Jan Iversen <jan@casacondor.com>
Diffstat (limited to 'desktop-widgets/diveplanner.cpp')
-rw-r--r--desktop-widgets/diveplanner.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp
index 76db75694..7724fab92 100644
--- a/desktop-widgets/diveplanner.cpp
+++ b/desktop-widgets/diveplanner.cpp
@@ -459,14 +459,13 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
ui.rebreathermode->insertItems(0, rebreather_modes);
modeMapper = new QSignalMapper(this);
- connect(modeMapper, SIGNAL(mapped(int)) , plannerShared::instance(), SLOT(set_planner_deco_mode(int)));
modeMapper->setMapping(ui.recreational_deco, int(RECREATIONAL));
modeMapper->setMapping(ui.buehlmann_deco, int(BUEHLMANN));
modeMapper->setMapping(ui.vpmb_deco, int(VPMB));
- connect(ui.recreational_deco, SIGNAL(clicked()), modeMapper, SLOT(map()));
- connect(ui.buehlmann_deco, SIGNAL(clicked()), modeMapper, SLOT(map()));
- connect(ui.vpmb_deco, SIGNAL(clicked()), modeMapper, SLOT(map()));
+ connect(ui.recreational_deco, &QAbstractButton::clicked, [=] { plannerShared::set_planner_deco_mode(RECREATIONAL); });
+ connect(ui.buehlmann_deco, &QAbstractButton::clicked, [=] { plannerShared::set_planner_deco_mode(BUEHLMANN); });
+ connect(ui.vpmb_deco, &QAbstractButton::clicked, [=] { plannerShared::set_planner_deco_mode(VPMB); });
connect(ui.lastStop, SIGNAL(toggled(bool)), plannerShared::instance(), SLOT(set_last_stop(bool)));
connect(ui.lastStop, SIGNAL(toggled(bool)), this, SLOT(disableBackgasBreaks(bool)));