mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:03:23 +00:00
dive list: when moving dives, delete first and add later
When moving dives between trips, the core moves the dives internally and sends a signal to the model. The model adds and removes the dives accordingly. However, when adding the new dive, the old trip hasn't changed its position, so the ordering is wrong leading to an inconsistent state. Therefore, remove the dives first and then readd them. There could still be pathological cases where this fails. However, in the short term this is an improvement. Note that in similar cases, the dives were indeed removed then added, so this case here seems to be an oversight. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
00abc04913
commit
cd22b86bf8
1 changed files with 1 additions and 1 deletions
|
@ -1325,8 +1325,8 @@ void DiveTripModelTree::divesMovedBetweenTrips(dive_trip *from, dive_trip *to, b
|
|||
// Cheating!
|
||||
// Unfortunately, removing the dives means that their selection is lost.
|
||||
// Thus, remember the selection and re-add it later.
|
||||
divesAdded(to, createTo, dives);
|
||||
divesDeletedInternal(from, deleteFrom, dives); // Use internal version to keep current dive
|
||||
divesAdded(to, createTo, dives);
|
||||
}
|
||||
|
||||
void DiveTripModelTree::divesTimeChanged(timestamp_t delta, const QVector<dive *> &dives)
|
||||
|
|
Loading…
Add table
Reference in a new issue