summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-11-14 18:45:32 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-15 09:27:41 +0900
commit0f50b73f9e885ba558b53a201f536e31a832dd22 (patch)
tree4e8c4f03ba59b66941b2d852ec161ad7a7a1a6be
parent1ee08005b2d98e895b173cbe77d5548383b82106 (diff)
downloadsubsurface-0f50b73f9e885ba558b53a201f536e31a832dd22.tar.gz
Fix planner / add dive handling of DiveHandler Points
Dirk, is this really necessary or it's just something that you forgot to remove? this is adding a bit of pain to fix some issues on the planner, so I'm commenting this out untill you have a bit of time to look at it. It looks like this was added to handle the gas in the pos-1, but you reverted if so, this completely reverts it, and things works as expected again. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/diveplanner.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 1c8448394..09214a625 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -422,7 +422,7 @@ void DivePlannerGraphics::mouseDoubleClickEvent(QMouseEvent* event)
void DivePlannerPointsModel::createSimpleDive()
{
- plannerModel->addStop(0, 0, O2_IN_AIR, 0, 0);
+// plannerModel->addStop(0, 0, O2_IN_AIR, 0, 0);
plannerModel->addStop(M_OR_FT(15,45), 1 * 60, O2_IN_AIR, 0, 0);
plannerModel->addStop(M_OR_FT(15,45), 40 * 60, O2_IN_AIR, 0, 0);
plannerModel->addStop(M_OR_FT(5,15), 42 * 60, O2_IN_AIR, 0, 0);
@@ -517,7 +517,7 @@ void DivePlannerGraphics::drawProfile()
// Re-position the user generated dive handlers
int last = 0;
- for (int i = 1; i < plannerModel->rowCount(); i++) {
+ for (int i = 0; i < plannerModel->rowCount(); i++) {
divedatapoint dp = plannerModel->at(i);
if (dp.time == 0) // those are the magic entries for tanks
continue;
@@ -1161,6 +1161,11 @@ int DivePlannerPointsModel::addStop(int milimeters, int minutes, int o2, int he,
if (o2 != -1)
if (!addGas(o2, he))
qDebug("addGas failed"); // FIXME add error propagation
+ /*
+ * Dirk, is this really necessary or it's just something that you forgot
+ * to remove? this is adding a bit of pain to fix some issues on the planner,
+ * so I'm commenting this out untill you have a bit of time to look at it.
+ *
if(row == 0) {
if (o2 == -1) {
o2 = O2_IN_AIR;
@@ -1176,7 +1181,7 @@ int DivePlannerPointsModel::addStop(int milimeters, int minutes, int o2, int he,
divepoints.append( point );
endInsertRows();
row++;
- }
+ } */
// check if there's already a new stop before this one:
for (int i = 0; i < row; i++) {