aboutsummaryrefslogtreecommitdiffstats
path: root/commands/command_divelist.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-06-28 15:24:19 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-09-29 16:13:03 -0700
commitf9721fce4b12faee87398d23fd2f8b4d1b9a0309 (patch)
tree0ca37231d70028eb2fdaf615a812af8c9983b1cf /commands/command_divelist.h
parent631be569fe5b277c4c1729019305e06b02cec611 (diff)
downloadsubsurface-f9721fce4b12faee87398d23fd2f8b4d1b9a0309.tar.gz
filter: implement importing of filter presets
When importing a divelog, import filter presets. If there are equal names, import only if the presets differ. In that case, disambiguate the name. This made things a bit more complicated, as comparison of filter presets had to be implemented. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'commands/command_divelist.h')
-rw-r--r--commands/command_divelist.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/commands/command_divelist.h b/commands/command_divelist.h
index f1bbc7a91..9569da031 100644
--- a/commands/command_divelist.h
+++ b/commands/command_divelist.h
@@ -5,6 +5,7 @@
#define COMMAND_DIVELIST_H
#include "command_base.h"
+#include "core/filterpreset.h"
#include <QVector>
@@ -97,7 +98,8 @@ private:
class ImportDives : public DiveListBase {
public:
// Note: dives and trips are consumed - after the call they will be empty.
- ImportDives(struct dive_table *dives, struct trip_table *trips, struct dive_site_table *sites, int flags, const QString &source);
+ ImportDives(struct dive_table *dives, struct trip_table *trips, struct dive_site_table *sites,
+ filter_preset_table_t *filter_presets, int flags, const QString &source);
private:
void undoit() override;
void redoit() override;
@@ -109,11 +111,14 @@ private:
// For redo
std::vector<OwningDiveSitePtr> sitesToAdd;
+ std::vector<std::pair<QString,FilterData>>
+ filterPresetsToAdd;
// For undo
std::vector<dive_site *> sitesToRemove;
- std::vector<dive *> selection;
- dive * currentDive;
+ std::vector<dive *> selection;
+ dive *currentDive;
+ std::vector<int> filterPresetsToRemove;
};
class DeleteDive : public DiveListBase {