From 2dcc0a7d1ebf6435060168f343df2adb5f0abb3c Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 13 Mar 2019 20:10:22 +0100 Subject: Undo: implement undo of dive site description editing Simply duplicate the code of dive site name editing. Split out the common functionality that swaps a C and a Qt string. Signed-off-by: Berthold Stoeger --- desktop-widgets/command_divesite.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'desktop-widgets/command_divesite.h') diff --git a/desktop-widgets/command_divesite.h b/desktop-widgets/command_divesite.h index 692e5c109..78622862e 100644 --- a/desktop-widgets/command_divesite.h +++ b/desktop-widgets/command_divesite.h @@ -38,6 +38,18 @@ private: QString value; // Value to be set }; +class EditDiveSiteDescription : public Base { +public: + EditDiveSiteDescription(dive_site *ds, const QString &description); +private: + bool workToBeDone() override; + void undo() override; + void redo() override; + + dive_site *ds; + QString value; // Value to be set +}; + } // namespace Command #endif // COMMAND_DIVESITE_H -- cgit v1.2.3-70-g09d2