Dive planner: remove the fake dive earlier on cancel

This way it's already gone from the dive list before it gets reprocessed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-05-28 05:16:53 -07:00
parent f8a773b37f
commit e4a438c96c

View file

@ -256,7 +256,6 @@ DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidg
connect(ui.buttonBox, SIGNAL(rejected()), plannerModel, SLOT(cancelPlan()));
connect(plannerModel, SIGNAL(planCreated()), MainWindow::instance(), SLOT(removeFakeDiveForAddAndPlan()));
connect(plannerModel, SIGNAL(planCreated()), MainWindow::instance(), SLOT(showProfile()));
connect(plannerModel, SIGNAL(planCanceled()), MainWindow::instance(), SLOT(removeFakeDiveForAddAndPlan()));
connect(plannerModel, SIGNAL(planCanceled()), MainWindow::instance(), SLOT(showProfile()));
/* set defaults. */
@ -654,8 +653,8 @@ void DivePlannerPointsModel::cancelPlan()
return;
}
}
clear();
// we unselected all dives earlier, so restore that first and then recreate the dive list
MainWindow::instance()->removeFakeDiveForAddAndPlan();
MainWindow::instance()->dive_list()->restoreSelection();
MainWindow::instance()->dive_list()->reload(DiveTripModel::CURRENT);
MainWindow::instance()->refreshDisplay();