From ad608e48f5759059c3115f566078ff3fca350252 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 17 Oct 2020 11:24:50 +0200 Subject: [PATCH] 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 --- desktop-widgets/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)