mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
undo: add missing invalidate_dive_cache() calls
The AddWeight, RemoveWeight, EditWeight and ReplanDive commands were missing invalidate_dive_cache() calls. Add them to ensure that the dives are written to git logs on save. Fixes #3150 Reported-by: Peter Zaal <peter.zaal@gmail.com> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
108f6fed2f
commit
5692f0d68a
2 changed files with 7 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
- undo: save to git after editing weights [#3159]
|
||||||
- desktop: complete rewrite of the statistics code, significantly expanding capabilities
|
- desktop: complete rewrite of the statistics code, significantly expanding capabilities
|
||||||
- desktop: add preferences option to disable default cylinder types
|
- desktop: add preferences option to disable default cylinder types
|
||||||
- mobile: add ability to show fundamentally the same statistics as on the desktop
|
- mobile: add ability to show fundamentally the same statistics as on the desktop
|
||||||
|
|
|
@ -838,6 +838,7 @@ void ReplanDive::undo()
|
||||||
std::swap(d->duration, duration);
|
std::swap(d->duration, duration);
|
||||||
std::swap(d->salinity, salinity);
|
std::swap(d->salinity, salinity);
|
||||||
fixup_dive(d);
|
fixup_dive(d);
|
||||||
|
invalidate_dive_cache(d); // Ensure that dive is written in git_save()
|
||||||
|
|
||||||
QVector<dive *> divesToNotify = { d };
|
QVector<dive *> divesToNotify = { d };
|
||||||
// Note that we have to emit cylindersReset before divesChanged, because the divesChanged
|
// Note that we have to emit cylindersReset before divesChanged, because the divesChanged
|
||||||
|
@ -875,6 +876,7 @@ void AddWeight::undo()
|
||||||
continue;
|
continue;
|
||||||
remove_weightsystem(d, d->weightsystems.nr - 1);
|
remove_weightsystem(d, d->weightsystems.nr - 1);
|
||||||
emit diveListNotifier.weightRemoved(d, d->weightsystems.nr);
|
emit diveListNotifier.weightRemoved(d, d->weightsystems.nr);
|
||||||
|
invalidate_dive_cache(d); // Ensure that dive is written in git_save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -883,6 +885,7 @@ void AddWeight::redo()
|
||||||
for (dive *d: dives) {
|
for (dive *d: dives) {
|
||||||
add_cloned_weightsystem(&d->weightsystems, empty_weightsystem);
|
add_cloned_weightsystem(&d->weightsystems, empty_weightsystem);
|
||||||
emit diveListNotifier.weightAdded(d, d->weightsystems.nr - 1);
|
emit diveListNotifier.weightAdded(d, d->weightsystems.nr - 1);
|
||||||
|
invalidate_dive_cache(d); // Ensure that dive is written in git_save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -954,6 +957,7 @@ void RemoveWeight::undo()
|
||||||
for (size_t i = 0; i < dives.size(); ++i) {
|
for (size_t i = 0; i < dives.size(); ++i) {
|
||||||
add_to_weightsystem_table(&dives[i]->weightsystems, indices[i], clone_weightsystem(ws));
|
add_to_weightsystem_table(&dives[i]->weightsystems, indices[i], clone_weightsystem(ws));
|
||||||
emit diveListNotifier.weightAdded(dives[i], indices[i]);
|
emit diveListNotifier.weightAdded(dives[i], indices[i]);
|
||||||
|
invalidate_dive_cache(dives[i]); // Ensure that dive is written in git_save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -962,6 +966,7 @@ void RemoveWeight::redo()
|
||||||
for (size_t i = 0; i < dives.size(); ++i) {
|
for (size_t i = 0; i < dives.size(); ++i) {
|
||||||
remove_weightsystem(dives[i], indices[i]);
|
remove_weightsystem(dives[i], indices[i]);
|
||||||
emit diveListNotifier.weightRemoved(dives[i], indices[i]);
|
emit diveListNotifier.weightRemoved(dives[i], indices[i]);
|
||||||
|
invalidate_dive_cache(dives[i]); // Ensure that dive is written in git_save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1012,6 +1017,7 @@ void EditWeight::redo()
|
||||||
for (size_t i = 0; i < dives.size(); ++i) {
|
for (size_t i = 0; i < dives.size(); ++i) {
|
||||||
set_weightsystem(dives[i], indices[i], new_ws);
|
set_weightsystem(dives[i], indices[i], new_ws);
|
||||||
emit diveListNotifier.weightEdited(dives[i], indices[i]);
|
emit diveListNotifier.weightEdited(dives[i], indices[i]);
|
||||||
|
invalidate_dive_cache(dives[i]); // Ensure that dive is written in git_save()
|
||||||
}
|
}
|
||||||
std::swap(ws, new_ws);
|
std::swap(ws, new_ws);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue