aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/maintab.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index d35fefcf9..81ae8f364 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -398,6 +398,8 @@ void MainTab::acceptChanges()
if (editMode == ADD) {
// clean up the dive data (get duration, depth information from samples)
fixup_dive(current_dive);
+ if (current_dive == get_dive(dive_table.nr - 1) && get_dive(dive_table.nr - 2)->number)
+ current_dive->number = get_dive(dive_table.nr - 2)->number + 1;
DivePlannerPointsModel::instance()->cancelPlan();
mainWindow()->showProfile();
mainWindow()->refreshDisplay();