mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Planner: really fix crash after aborting planner
Duh. We had to reload the list (and make sure the internal data structures are recreated as well) before restoring the selection. I also switched to simply accessing the widget directly, instead of via the dive_list() call. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
97e56b0382
commit
5afabfc9eb
1 changed files with 3 additions and 8 deletions
|
@ -247,7 +247,7 @@ void MainWindow::on_actionClose_triggered()
|
|||
while (dive_table.nr)
|
||||
delete_single_dive(0);
|
||||
|
||||
dive_list()->clearSelection();
|
||||
ui.ListWidget->clearSelection();
|
||||
/* clear the selection and the statistics */
|
||||
selected_dive = -1;
|
||||
|
||||
|
@ -401,13 +401,8 @@ void MainWindow::planCanceled()
|
|||
{
|
||||
removeFakeDiveForAddAndPlan();
|
||||
showProfile();
|
||||
// restoring the selection causes a crash - somehow the model appears to be confused
|
||||
// or maybe our internal data structures are messed up?
|
||||
// commenting this out fixes the crash
|
||||
//
|
||||
// dive_list()->restoreSelection();
|
||||
|
||||
dive_list()->reload(DiveTripModel::CURRENT);
|
||||
ui.ListWidget->reload(DiveTripModel::CURRENT);
|
||||
ui.ListWidget->restoreSelection();
|
||||
refreshDisplay();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue