summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2020-01-02 15:05:54 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-06 10:34:42 +0900
commitfa72288ca245e406fe8b05484c7110b9da53e46d (patch)
treeff324c7f115fd2dbf4b9d3e1542a4f2f6f7248e8 /desktop-widgets
parente2d568acc147cf7c43e61950a96df652a5bb9234 (diff)
downloadsubsurface-fa72288ca245e406fe8b05484c7110b9da53e46d.tar.gz
desktop-widgets: remove use of QSignalMapper.
QSignalMapper gives a warning that it is depreciated, and the doc. states that using a lambda function is more efficient. Replace use of QSignalMapper. Signed-off-by: Jan Iversen <jan@casacondor.com>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/diveplanner.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp
index 7724fab92..73beae89f 100644
--- a/desktop-widgets/diveplanner.cpp
+++ b/desktop-widgets/diveplanner.cpp
@@ -458,11 +458,6 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
rebreather_modes.append(gettextFromC::tr(divemode_text_ui[i]));
ui.rebreathermode->insertItems(0, rebreather_modes);
- modeMapper = new QSignalMapper(this);
- 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, &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); });
@@ -494,7 +489,10 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
connect(ui.rebreathermode, SIGNAL(currentIndexChanged(int)), plannerModel, SLOT(setRebreatherMode(int)));
connect(ui.rebreathermode, SIGNAL(currentIndexChanged(int)), this, SLOT(setBailoutVisibility(int)));
- connect(modeMapper, SIGNAL(mapped(int)), this, SLOT(disableDecoElements(int)));
+ connect(ui.recreational_deco, &QAbstractButton::clicked, [=] { disableDecoElements(RECREATIONAL); });
+ connect(ui.buehlmann_deco, &QAbstractButton::clicked, [=] { disableDecoElements(BUEHLMANN); });
+ connect(ui.vpmb_deco, &QAbstractButton::clicked, [=] { disableDecoElements(VPMB); });
+
connect(ui.ascRate75, SIGNAL(valueChanged(int)), plannerShared::instance(), SLOT(set_ascrate75(int)));
connect(ui.ascRate50, SIGNAL(valueChanged(int)), plannerShared::instance(), SLOT(set_ascrate50(int)));
connect(ui.descRate, SIGNAL(valueChanged(int)), plannerShared::instance(), SLOT(set_descrate(int)));