summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command_divesite.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-03-19 19:52:54 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-12 18:19:07 +0300
commit8858bfa1f8cf30cc4eb070fb6e709f7051e61241 (patch)
tree02c40484ff879ce3bba48085c6fab2809cef43ea /desktop-widgets/command_divesite.h
parentfde80eeaa5f4ee4150f9292c5783eb790b0fcb96 (diff)
downloadsubsurface-8858bfa1f8cf30cc4eb070fb6e709f7051e61241.tar.gz
Dive site: implement purge of unused dive sites
Add a "purge unused dive sites" button to the dive site list. Connect it to a new PurgeUnusedDiveSites command. Implementation was trivial: simply copy the DeleteDiveSites command. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/command_divesite.h')
-rw-r--r--desktop-widgets/command_divesite.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/desktop-widgets/command_divesite.h b/desktop-widgets/command_divesite.h
index 58b3aabf5..9661bbffd 100644
--- a/desktop-widgets/command_divesite.h
+++ b/desktop-widgets/command_divesite.h
@@ -43,6 +43,21 @@ private:
std::vector<OwningDiveSitePtr> sitesToAdd;
};
+class PurgeUnusedDiveSites : public Base {
+public:
+ PurgeUnusedDiveSites();
+private:
+ bool workToBeDone() override;
+ void undo() override;
+ void redo() override;
+
+ // For redo
+ std::vector<dive_site *> sitesToRemove;
+
+ // For undo
+ std::vector<OwningDiveSitePtr> sitesToAdd;
+};
+
class EditDiveSiteName : public Base {
public:
EditDiveSiteName(dive_site *ds, const QString &name);