filter: don't add to filter presets when importing dive sites

When importing dive-sites we would add to the global filter-preset
table. This data should be thrown away, just like the other tables
that might be imported.

This shows that we really should introduce a "struct divelog",
which collects all those tables into a single structure.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-10-17 11:24:50 +02:00 committed by Dirk Hohndel
parent a7bbb6c1cc
commit ad608e48f5

View file

@ -1644,10 +1644,11 @@ void MainWindow::on_actionImportDiveSites_triggered()
struct dive_table table = empty_dive_table;
struct trip_table trips = empty_trip_table;
struct dive_site_table sites = empty_dive_site_table;
struct filter_preset_table filter_presets;
for (const QString &s: fileNames) {
QByteArray fileNamePtr = QFile::encodeName(s);
parse_file(fileNamePtr.data(), &table, &trips, &sites, &filter_preset_table);
parse_file(fileNamePtr.data(), &table, &trips, &sites, &filter_presets);
}
// The imported dive sites still have pointers to imported dives - remove them
for (int i = 0; i < sites.nr; ++i)