From e90f5c28df8e609c22ff2f7d52a00b56c5eaa1db Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 5 Nov 2013 15:38:41 +0900 Subject: Fix dive merging When merging dives, the indices of the following dives change - so we need to adjust the variable used in the for_each loop. Signed-off-by: Dirk Hohndel --- qt-ui/divelistview.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qt-ui/divelistview.cpp') diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index a78e48777..92a10ca38 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -309,10 +309,12 @@ void DiveListView::mergeDives() for_each_dive(i, dive) { if (dive->selected) { - if (!maindive) + if (!maindive) { maindive = dive; - else + } else { maindive = merge_two_dives(maindive, dive); + i--; // otherwise we skip a dive in the freshly changed list + } } } mainWindow()->refreshDisplay(); -- cgit v1.2.3-70-g09d2