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>
This commit is contained in:
Berthold Stoeger 2020-06-28 15:24:19 +02:00 committed by Dirk Hohndel
parent 631be569fe
commit f9721fce4b
14 changed files with 81 additions and 13 deletions

View file

@ -3,6 +3,7 @@
#define COMMAND_H
#include "core/dive.h"
#include "core/filterpreset.h"
#include "core/pictureobj.h"
#include <QVector>
#include <QAction>
@ -32,7 +33,8 @@ QString changesMade(); // return a string with the texts from all commands on
// insertion position.
void addDive(dive *d, bool autogroup, bool newNumber);
void importDives(struct dive_table *dives, struct trip_table *trips,
struct dive_site_table *sites, int flags, const QString &source); // The tables are consumed!
struct dive_site_table *sites, filter_preset_table_t *filter_presets,
int flags, const QString &source); // The tables are consumed!
void deleteDive(const QVector<struct dive*> &divesToDelete);
void shiftTime(const std::vector<dive *> &changedDives, int amount);
void renumberDives(const QVector<QPair<dive *, int>> &divesToRenumber);