mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <dirk@hohndel.org>
This commit is contained in:
parent
01d515b5d8
commit
e90f5c28df
1 changed files with 4 additions and 2 deletions
|
@ -309,10 +309,12 @@ void DiveListView::mergeDives()
|
||||||
|
|
||||||
for_each_dive(i, dive) {
|
for_each_dive(i, dive) {
|
||||||
if (dive->selected) {
|
if (dive->selected) {
|
||||||
if (!maindive)
|
if (!maindive) {
|
||||||
maindive = dive;
|
maindive = dive;
|
||||||
else
|
} else {
|
||||||
maindive = merge_two_dives(maindive, dive);
|
maindive = merge_two_dives(maindive, dive);
|
||||||
|
i--; // otherwise we skip a dive in the freshly changed list
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mainWindow()->refreshDisplay();
|
mainWindow()->refreshDisplay();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue