summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-10-17 11:24:50 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-17 09:04:20 -0700
commitad608e48f5759059c3115f566078ff3fca350252 (patch)
treee080d9e4c92b28e05dba024b7e77b32e4cd5027d
parenta7bbb6c1cc5c5b9ed3dc48cdb4da910214d51e96 (diff)
downloadsubsurface-ad608e48f5759059c3115f566078ff3fca350252.tar.gz
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>
-rw-r--r--desktop-widgets/mainwindow.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index e14c49174..14619abae 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -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)