mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Dive planner: remember the selection before new dives get handled
On an empty dive list we would remember the new dive (which gets auto-selected since it's the only dive) and then crash when we try to restore that selection after cancel (in which case that new dive is gone). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
424d38e0c1
commit
f8a773b37f
1 changed files with 1 additions and 1 deletions
|
@ -378,9 +378,9 @@ void MainWindow::createFakeDiveForAddAndPlan()
|
|||
dive->longitude.udeg = 0;
|
||||
record_dive(dive);
|
||||
// select this new dive (but remember the old selection
|
||||
ui.ListWidget->reload(DiveTripModel::CURRENT);
|
||||
ui.ListWidget->rememberSelection();
|
||||
ui.ListWidget->unselectDives();
|
||||
ui.ListWidget->reload(DiveTripModel::CURRENT);
|
||||
ui.ListWidget->selectDives(QList<int>() << dive_table.nr - 1);
|
||||
ui.InfoWidget->updateDiveInfo(selected_dive);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue