mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
27a89b0232
commit
cc55c442a3
6 changed files with 81 additions and 44 deletions
|
@ -267,6 +267,7 @@ private:
|
|||
void undoit() override;
|
||||
void redoit() override;
|
||||
bool workToBeDone() override;
|
||||
void swapDivesite(); // Common code for undo and redo.
|
||||
|
||||
// For redo
|
||||
// Add one and remove a batch of dives
|
||||
|
@ -284,6 +285,8 @@ private:
|
|||
|
||||
// For undo and redo
|
||||
QVector<QPair<dive *, int>> divesToRenumber;
|
||||
dive_site *site;
|
||||
location_t location;
|
||||
};
|
||||
|
||||
} // namespace Command
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue