summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
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;
}