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>
This commit is contained in:
Dirk Hohndel 2014-07-03 21:33:44 -07:00
parent 947d7b77df
commit 5fca5f421d

View file

@ -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