summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2020-01-20 10:48:31 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-20 15:45:20 -0800
commitd924afdf52b578c3afccfc7e702acdbb7800d38c (patch)
tree532ad29abd843d603529f6d1c5e9c8bbe8995776
parentb1751ac0c601846d7e2dcf629bfd157bda4d39ef (diff)
downloadsubsurface-d924afdf52b578c3afccfc7e702acdbb7800d38c.tar.gz
qt-models: add suffix Display to unit system aware asc/desc setters
Change ascent/descent setter function names to set_<name>Display to show the value is prepared for displaying (common for desktop and QML). Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--desktop-widgets/diveplanner.cpp10
-rw-r--r--qt-models/diveplannermodel.cpp10
-rw-r--r--qt-models/diveplannermodel.h10
3 files changed, 15 insertions, 15 deletions
diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp
index f3e345d8c..b3c4fe631 100644
--- a/desktop-widgets/diveplanner.cpp
+++ b/desktop-widgets/diveplanner.cpp
@@ -467,11 +467,11 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
connect(ui.display_transitions, &QAbstractButton::toggled, plannerShared::instance(), &plannerShared::set_display_transitions);
connect(ui.safetystop, &QAbstractButton::toggled, plannerShared::instance(), &plannerShared::set_safetystop);
connect(ui.reserve_gas, QOverload<int>::of(&QSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_reserve_gas);
- connect(ui.ascRate75, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscrate75);
- connect(ui.ascRate50, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscrate50);
- connect(ui.ascRateStops, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscratestops);
- connect(ui.ascRateLast6m, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscratelast6m);
- connect(ui.descRate, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setDescrate);
+ connect(ui.ascRate75, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscrate75Display);
+ connect(ui.ascRate50, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscrate50Display);
+ connect(ui.ascRateStops, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscratestopsDisplay);
+ connect(ui.ascRateLast6m, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscratelast6mDisplay);
+ connect(ui.descRate, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setDescrateDisplay);
connect(ui.drop_stone_mode, &QAbstractButton::toggled, plannerShared::instance(), &plannerShared::set_drop_stone_mode);
connect(ui.gfhigh, QOverload<int>::of(&QSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_gfhigh);
connect(ui.gflow, QOverload<int>::of(&QSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_gflow);
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index d3f9c4c6c..7694b185e 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -515,7 +515,7 @@ void DivePlannerPointsModel::setLastStop6m(bool value)
emitDataChanged();
}
-void DivePlannerPointsModel::setAscrate75(int rate)
+void DivePlannerPointsModel::setAscrate75Display(int rate)
{
qPrefDivePlanner::set_ascrate75(lrint(rate * UNIT_FACTOR));
emitDataChanged();
@@ -525,7 +525,7 @@ int DivePlannerPointsModel::ascrate75Display()
return lrint((float)prefs.ascrate75 / UNIT_FACTOR);
}
-void DivePlannerPointsModel::setAscrate50(int rate)
+void DivePlannerPointsModel::setAscrate50Display(int rate)
{
qPrefDivePlanner::set_ascrate50(lrint(rate * UNIT_FACTOR));
emitDataChanged();
@@ -535,7 +535,7 @@ int DivePlannerPointsModel::ascrate50Display()
return lrint((float)prefs.ascrate50 / UNIT_FACTOR);
}
-void DivePlannerPointsModel::setAscratestops(int rate)
+void DivePlannerPointsModel::setAscratestopsDisplay(int rate)
{
qPrefDivePlanner::set_ascratestops(lrint(rate * UNIT_FACTOR));
emitDataChanged();
@@ -545,7 +545,7 @@ int DivePlannerPointsModel::ascratestopsDisplay()
return lrint((float)prefs.ascratestops / UNIT_FACTOR);
}
-void DivePlannerPointsModel::setAscratelast6m(int rate)
+void DivePlannerPointsModel::setAscratelast6mDisplay(int rate)
{
qPrefDivePlanner::set_ascratelast6m(lrint(rate * UNIT_FACTOR));
emitDataChanged();
@@ -555,7 +555,7 @@ int DivePlannerPointsModel::ascratelast6mDisplay()
return lrint((float)prefs.ascratelast6m / UNIT_FACTOR);
}
-void DivePlannerPointsModel::setDescrate(int rate)
+void DivePlannerPointsModel::setDescrateDisplay(int rate)
{
qPrefDivePlanner::set_descrate(lrint(rate * UNIT_FACTOR));
emitDataChanged();
diff --git a/qt-models/diveplannermodel.h b/qt-models/diveplannermodel.h
index 88cca5879..23d9ada02 100644
--- a/qt-models/diveplannermodel.h
+++ b/qt-models/diveplannermodel.h
@@ -104,11 +104,11 @@ slots:
void setSurfaceSegment(int duration);
void setSacFactor(double factor);
void setProblemSolvingTime(int minutes);
- void setAscrate75(int rate);
- void setAscrate50(int rate);
- void setAscratestops(int rate);
- void setAscratelast6m(int rate);
- void setDescrate(int rate);
+ void setAscrate75Display(int rate);
+ void setAscrate50Display(int rate);
+ void setAscratestopsDisplay(int rate);
+ void setAscratelast6mDisplay(int rate);
+ void setDescrateDisplay(int rate);
signals:
void planCreated();