aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-05-21 23:31:26 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-22 14:41:26 +0900
commitf99ccc8ac2ba4ebcf2ae69e03ba9183ea71a0025 (patch)
tree1bf91fbfbc4d4b35c53dea57139d6335802c8549 /qt-ui/diveplanner.cpp
parentc6ad04d076a24001ded7bc099498dd6deb97949b (diff)
downloadsubsurface-f99ccc8ac2ba4ebcf2ae69e03ba9183ea71a0025.tar.gz
Profile now correctly displays the planned dive.
But it doesn't move the handlers yet, and when you confirm it you also must click on the dive to select it or the profile will show garbage. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp26
1 files changed, 1 insertions, 25 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index f4f3d5036..6e11f84aa 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -150,13 +150,6 @@ DivePlannerGraphics::DivePlannerGraphics(QWidget *parent) : QGraphicsView(parent
ADD_ACTION(Qt::Key_Right, keyRightAction());
#undef ADD_ACTION
- connect(plannerModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(drawProfile()));
- connect(plannerModel, SIGNAL(cylinderModelEdited()), this, SLOT(drawProfile()));
-
- connect(plannerModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
- this, SLOT(pointInserted(const QModelIndex &, int, int)));
- connect(plannerModel, SIGNAL(rowsRemoved(const QModelIndex &, int, int)),
- this, SLOT(pointsRemoved(const QModelIndex &, int, int)));
setRenderHint(QPainter::Antialiasing);
}
@@ -504,23 +497,6 @@ void DivePlannerGraphics::drawProfile()
depthLine->updateTicks();
}
- // Re-position the user generated dive handlers
- int last = 0;
- for (int i = 0; i < plannerModel->rowCount(); i++) {
- struct divedatapoint datapoint = plannerModel->at(i);
- if (datapoint.time == 0) // those are the magic entries for tanks
- continue;
- DiveHandler *h = handles.at(i);
- h->setPos(timeLine->posAtValue(datapoint.time / 60), depthLine->posAtValue(datapoint.depth));
- QPointF p1 = (last == i) ? QPointF(timeLine->posAtValue(0), depthLine->posAtValue(0)) : handles[last]->pos();
- QPointF p2 = handles[i]->pos();
- QLineF line(p1, p2);
- QPointF pos = line.pointAt(0.5);
- gases[i]->setPos(pos);
- gases[i]->setText(dpGasToStr(plannerModel->at(i)));
- last = i;
- }
-
// (re-) create the profile with different colors for segments that were
// entered vs. segments that were calculated
double lastx = timeLine->posAtValue(0);
@@ -1379,7 +1355,7 @@ void DivePlannerPointsModel::remove(const QModelIndex &index)
endRemoveRows();
}
-struct diveplan DivePlannerPointsModel::getDiveplan()
+struct diveplan& DivePlannerPointsModel::getDiveplan()
{
return diveplan;
}