aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-09-09 20:45:03 +0000
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-09-09 20:45:03 +0000
commit813722633df15f6d5615938ae7200b14f725069a (patch)
tree326d3339b952bbf4bd87334c495edcff3229302a /qt-ui
parent167a55f6f5285c7c6572116ef98f3818eb331edd (diff)
downloadsubsurface-813722633df15f6d5615938ae7200b14f725069a.tar.gz
Last gas used will be used on new dive planner point.
This patch makes the last gas used on the planner the default. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/diveplanner.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index cd0eaceec..e2374e1f1 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -1040,9 +1040,15 @@ int DivePlannerPointsModel::addStop(int meters, int minutes, const QString& gas,
divedatapoint point;
point.depth = meters;
point.time = minutes;
- point.o2 = 209;
- point.he = 0;
- point.po2 = 0;
+ if (row == 0){
+ point.o2 = 209;
+ point.he = 0;
+ point.po2 = 0;
+ }else{
+ divedatapoint before = at(row-1);
+ point.o2 = before.o2;
+ point.he = before.he;
+ }
divepoints.append( point );
std::sort(divepoints.begin(), divepoints.end(), divePointsLessThan);
endInsertRows();