From d924afdf52b578c3afccfc7e702acdbb7800d38c Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Mon, 20 Jan 2020 10:48:31 +0100 Subject: qt-models: add suffix Display to unit system aware asc/desc setters Change ascent/descent setter function names to set_Display to show the value is prepared for displaying (common for desktop and QML). Signed-off-by: jan Iversen Signed-off-by: Dirk Hohndel --- qt-models/diveplannermodel.cpp | 10 +++++----- qt-models/diveplannermodel.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'qt-models') 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(); -- cgit v1.2.3-70-g09d2