mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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;
|
dive->longitude.udeg = 0;
|
||||||
record_dive(dive);
|
record_dive(dive);
|
||||||
// select this new dive (but remember the old selection
|
// select this new dive (but remember the old selection
|
||||||
ui.ListWidget->reload(DiveTripModel::CURRENT);
|
|
||||||
ui.ListWidget->rememberSelection();
|
ui.ListWidget->rememberSelection();
|
||||||
ui.ListWidget->unselectDives();
|
ui.ListWidget->unselectDives();
|
||||||
|
ui.ListWidget->reload(DiveTripModel::CURRENT);
|
||||||
ui.ListWidget->selectDives(QList<int>() << dive_table.nr - 1);
|
ui.ListWidget->selectDives(QList<int>() << dive_table.nr - 1);
|
||||||
ui.InfoWidget->updateDiveInfo(selected_dive);
|
ui.InfoWidget->updateDiveInfo(selected_dive);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue