summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--profile-widget/profilewidget2.cpp2
-rw-r--r--qt-models/diveplannermodel.cpp3
-rw-r--r--qt-models/diveplannermodel.h2
3 files changed, 4 insertions, 3 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 0ad2b5601..38aa9d64f 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -932,7 +932,7 @@ void ProfileWidget2::mouseDoubleClickEvent(QMouseEvent *event)
int minutes = rint(timeAxis->valueAt(mappedPos) / 60);
int milimeters = rint(profileYAxis->valueAt(mappedPos) / M_OR_FT(1, 1)) * M_OR_FT(1, 1);
- plannerModel->addStop(milimeters, minutes * 60, 0, 0, true);
+ plannerModel->addStop(milimeters, minutes * 60, -1, 0, true);
}
}
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index 5a06313f4..38fbbb1b8 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -588,11 +588,12 @@ int DivePlannerPointsModel::lastEnteredPoint()
return -1;
}
+// cylinderid_in == -1 means same gas as before.
int DivePlannerPointsModel::addStop(int milimeters, int seconds, int cylinderid_in, int ccpoint, bool entered)
{
int cylinderid = 0;
bool usePrevious = false;
- if (cylinderid_in)
+ if (cylinderid_in >= 0)
cylinderid = cylinderid_in;
else
usePrevious = true;
diff --git a/qt-models/diveplannermodel.h b/qt-models/diveplannermodel.h
index eff668909..e9227f671 100644
--- a/qt-models/diveplannermodel.h
+++ b/qt-models/diveplannermodel.h
@@ -57,7 +57,7 @@ public:
public
slots:
- int addStop(int millimeters = 0, int seconds = 0, int cylinderid_in = 0, int ccpoint = 0, bool entered = true);
+ int addStop(int millimeters = 0, int seconds = 0, int cylinderid_in = -1, int ccpoint = 0, bool entered = true);
void addCylinder_clicked();
void setGFHigh(const int gfhigh);
void triggerGFHigh();