diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-07-03 21:33:44 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-03 21:33:44 -0700 |
commit | 5fca5f421d72e6a618e012c7ce195852ed539700 (patch) | |
tree | 008f034065fb31da23d474379adedab1396145c5 /qt-ui/mainwindow.cpp | |
parent | 947d7b77df48cfa251a6f3a56b6b56d3bc33747f (diff) | |
download | subsurface-5fca5f421d72e6a618e012c7ce195852ed539700.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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 |