diff options
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/diveplannermodel.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 6bb560098..ea24c3a73 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -46,6 +46,16 @@ void DivePlannerPointsModel::removeSelectedPoints(const QVector<int> &rows) void DivePlannerPointsModel::createSimpleDive() { + // clean out the dive and give it an id and the correct dc model + clear_dive(&displayed_dive); + displayed_dive.id = dive_getUniqID(); + displayed_dive.when = QDateTime::currentMSecsSinceEpoch() / 1000L + gettimezoneoffset() + 3600; + displayed_dive.dc.model = strdup("planned dive"); // don't translate! this is stored in the XML file + + clear(); + setupCylinders(); + setupStartTime(); + // initialize the start time in the plan diveplan.when = displayed_dive.when; |