mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix crash when trying to add a dive or plan when a filter is active.
The planner used the selected dive on the dive list, and when there's a filtering in action it can be in a state where there's no dive selected. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
81fd56b16f
commit
f6d133d742
3 changed files with 9 additions and 0 deletions
|
@ -825,3 +825,9 @@ void DiveListView::updateLastImageTimeOffset(const int offset)
|
|||
s.beginGroup("MainWindow");
|
||||
s.setValue("LastImageTimeOffset", offset);
|
||||
}
|
||||
|
||||
void DiveListView::endSearch()
|
||||
{
|
||||
searchBox.clear();
|
||||
searchBox.hide();
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ slots:
|
|||
void shiftTimes();
|
||||
void loadImages();
|
||||
static QString lastUsedImageDir();
|
||||
void endSearch();
|
||||
|
||||
signals:
|
||||
void currentDiveChanged(int divenr);
|
||||
|
|
|
@ -467,6 +467,7 @@ void MainWindow::on_actionDivePlanner_triggered()
|
|||
if(!plannerStateClean())
|
||||
return;
|
||||
|
||||
ui.ListWidget->endSearch();
|
||||
// put us in PLAN mode
|
||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
|
||||
ui.newProfile->setPlanState();
|
||||
|
@ -497,6 +498,7 @@ void MainWindow::on_actionAddDive_triggered()
|
|||
if(!plannerStateClean())
|
||||
return;
|
||||
|
||||
ui.ListWidget->endSearch();
|
||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
|
||||
|
||||
createFakeDiveForAddAndPlan();
|
||||
|
|
Loading…
Add table
Reference in a new issue