core: fix undo of dive merging

When merging two dives, if a divesite is chosen that doesn't
have a GPS location, but another divesite has a GPS location,
then the GPS location of the former is set to that of the
latter.

However, that was done outside of the undo system, so that
it is not undone and the frontend is not made aware of the
change.

Fix this. To simplify things, move the code from the undo
machinery to the core.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-09-01 14:12:05 +02:00 committed by Michael Keller
parent 27a89b0232
commit cc55c442a3
6 changed files with 81 additions and 44 deletions

View file

@ -149,6 +149,12 @@ QVector<T> stdToQt(const std::vector<T> &v)
#endif
}
template<typename T>
std::vector<T> qtToStd(const QVector<T> &v)
{
return std::vector<T>(v.begin(), v.end());
}
// We put everything in a namespace, so that we can shorten names without polluting the global namespace
namespace Command {