summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-28 13:17:20 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-28 13:17:20 -0700
commit5afabfc9eb0a09539e97b15c24f92290549ccea9 (patch)
tree85ba30cf71876a1f115a9ff8e488b3076c04907a /qt-ui/mainwindow.cpp
parent97e56b03827c2aa860ce025853c759ed96790221 (diff)
downloadsubsurface-5afabfc9eb0a09539e97b15c24f92290549ccea9.tar.gz
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>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index a3247636e..82276f32e 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -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();
}