mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Undo: return number of changed dives from undo commands
To enable a "multiple dives edited" message, return the number of edited dives from dive edit undo commands. Since there are two kinds of these commands, viz. normal fields and tag fields, and the former use templates, create a common base class that can return the number of dives. Yes, the class hierarchy is getting scarily deep! At least, this gives a tiny bit of code-reuse. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
1641147e7b
commit
03d5e641e1
5 changed files with 87 additions and 67 deletions
|
@ -166,9 +166,9 @@ public:
|
|||
virtual bool workToBeDone() = 0;
|
||||
};
|
||||
|
||||
// Put a command on the undoStack, but test whether there is something to be done
|
||||
// beforehand by calling the workToBeDone() function. If nothing is to be done,
|
||||
// the command will be deleted.
|
||||
// Put a command on the undoStack (and take ownership), but test whether there
|
||||
// is something to be done beforehand by calling the workToBeDone() function.
|
||||
// If nothing is to be done, the command will be deleted.
|
||||
void execute(Base *cmd);
|
||||
|
||||
} // namespace Command
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue