[PATCH 3/3] Remove some unneeded member functions

Anton Lundin glance at acc.umu.se
Thu Nov 14 10:55:35 UTC 2013


We can wire qt to call the right functions directly, so we don't need
these members.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 qt-ui/diveplanner.cpp | 14 ++------------
 qt-ui/diveplanner.h   |  2 --
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 17c10ca..18a9756 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -925,13 +925,13 @@ DivePlannerWidget::DivePlannerWidget(QWidget* parent, Qt::WindowFlags f): QWidge
 	connect(ui.cylinderTableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addCylinder_clicked()));
 	connect(ui.tableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addStop()));
 	ui.tableWidget->setBtnToolTip(tr("add dive data point"));
-	connect(ui.startTime, SIGNAL(timeChanged(QTime)), this, SLOT(startTimeChanged(QTime)));
+	connect(ui.startTime, SIGNAL(timeChanged(QTime)), plannerModel, SLOT(setStartTime(QTime)));
 	connect(ui.ATMPressure, SIGNAL(textChanged(QString)), this, SLOT(atmPressureChanged(QString)));
 	connect(ui.bottomSAC, SIGNAL(textChanged(QString)), this, SLOT(bottomSacChanged(QString)));
 	connect(ui.decoStopSAC, SIGNAL(textChanged(QString)), this, SLOT(decoSacChanged(QString)));
 	connect(ui.gfhigh, SIGNAL(valueChanged(int)), plannerModel, SLOT(setGFHigh(int)));
 	connect(ui.gflow, SIGNAL(valueChanged(int)), plannerModel, SLOT(setGFLow(int)));
-	connect(ui.lastStop, SIGNAL(toggled(bool)), this, SLOT(lastStopChanged(bool)));
+	connect(ui.lastStop, SIGNAL(toggled(bool)), plannerModel, SLOT(setLastStop6m(bool)));
 
 	// Creating the plan
 	connect(ui.buttonBox, SIGNAL(accepted()), plannerModel, SLOT(createPlan()));
@@ -957,11 +957,6 @@ void DivePlannerPointsModel::addCylinder_clicked()
 	CylindersModel::instance()->add();
 }
 
-void DivePlannerWidget::startTimeChanged(const QTime& time)
-{
-	plannerModel->setStartTime(time);
-}
-
 void DivePlannerWidget::atmPressureChanged(const QString& pressure)
 {
 	plannerModel->setSurfacePressure(pressure.toInt());
@@ -977,11 +972,6 @@ void DivePlannerWidget::decoSacChanged(const QString& decosac)
 	plannerModel->setDecoSac(decosac.toInt());
 }
 
-void DivePlannerWidget::lastStopChanged(bool checked)
-{
-	plannerModel->setLastStop6m(checked);
-}
-
 void DivePlannerPointsModel::setPlanMode(Mode m)
 {
 	mode = m;
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h
index e59fd55..139c3ab 100644
--- a/qt-ui/diveplanner.h
+++ b/qt-ui/diveplanner.h
@@ -223,11 +223,9 @@ public:
     explicit DivePlannerWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
 
 public slots:
-	void startTimeChanged(const QTime& time);
 	void atmPressureChanged(const QString& pressure);
 	void bottomSacChanged(const QString& bottomSac);
 	void decoSacChanged(const QString& decosac);
-	void lastStopChanged(bool checked);
 private:
 	Ui::DivePlanner ui;
 };
-- 
1.8.3.2



More information about the subsurface mailing list