summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command_base.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-05-23 20:27:19 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-06-15 11:20:49 -0700
commit03d5e641e1284b9613f605690d04faf48ac40715 (patch)
treea58f1a8157af423f9a50f0030f5ed96b86508623 /desktop-widgets/command_base.h
parent1641147e7b77db69f829cf9b41de4c313d45e3ed (diff)
downloadsubsurface-03d5e641e1284b9613f605690d04faf48ac40715.tar.gz
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>
Diffstat (limited to 'desktop-widgets/command_base.h')
-rw-r--r--desktop-widgets/command_base.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/desktop-widgets/command_base.h b/desktop-widgets/command_base.h
index 26744dc87..cf8f248d2 100644
--- a/desktop-widgets/command_base.h
+++ b/desktop-widgets/command_base.h
@@ -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