From 0f1381f1609af6b9e7a09b3423741a4e713fbff4 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 18 Aug 2014 14:12:05 -0500 Subject: Planner: assign a dive number if the right number seems obvious Use the same logic as we do for newly added dives. As a side effect this patch appears to fix the issues with getting the newly planned dive selected. Fixes #692 Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'qt-ui/maintab.cpp') diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 5002a2880..6bb6f14f8 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -771,10 +771,7 @@ void MainTab::acceptChanges() } if (editMode == ADD || editMode == MANUALLY_ADDED_DIVE) { fixup_dive(current_dive); - if (dive_table.nr == 1) - current_dive->number = 1; - else if (selected_dive == dive_table.nr - 1 && get_dive(dive_table.nr - 2)->number) - current_dive->number = get_dive(dive_table.nr - 2)->number + 1; + set_dive_nr_for_current_dive(); MainWindow::instance()->showProfile(); mark_divelist_changed(true); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::NOTHING); -- cgit v1.2.3-70-g09d2