From 5fca5f421d72e6a618e012c7ce195852ed539700 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 3 Jul 2014 21:33:44 -0700 Subject: UI restructure: when adding a dive via displayed_dive it needs valid id Otherwise we have one (or - yikes - more) dives with id 0. Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 0eb753203..2fc700752 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -491,6 +491,8 @@ void MainWindow::on_actionAddDive_triggered() DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD); clear_dive(&displayed_dive); + // but wait - we need a valid id... and a start time and an appropriatae dc model + displayed_dive.id = dive_getUniqID(&displayed_dive); displayed_dive.when = QDateTime::currentMSecsSinceEpoch() / 1000L + gettimezoneoffset() + 3600; displayed_dive.dc.model = "manually added dive"; // don't translate! this is stored in the XML file -- cgit v1.2.3-70-g09d2