diff options
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/divelogimportdialog.cpp | 10 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 9 | ||||
-rw-r--r-- | desktop-widgets/subsurfacewebservices.cpp | 3 |
3 files changed, 13 insertions, 9 deletions
diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp index 877c6f7c8..f3d512009 100644 --- a/desktop-widgets/divelogimportdialog.cpp +++ b/desktop-widgets/divelogimportdialog.cpp @@ -10,6 +10,7 @@ #include <QRegExp> #include <QUndoStack> #include <QPainter> +#include "core/filterpreset.h" #include "core/qthelper.h" #include "core/divesite.h" #include "core/trip.h" @@ -908,11 +909,12 @@ void DiveLogImportDialog::on_buttonBox_accepted() struct dive_table table = empty_dive_table; struct trip_table trips = empty_trip_table; struct dive_site_table sites = empty_dive_site_table; + filter_preset_table_t filter_presets; QStringList r = resultModel->result(); if (ui->knownImports->currentText() != "Manual import") { for (int i = 0; i < fileNames.size(); ++i) { if (ui->knownImports->currentText() == "Seabear CSV") { - parse_seabear_log(qPrintable(fileNames[i]), &table, &trips, &sites); + parse_seabear_log(qPrintable(fileNames[i]), &table, &trips, &sites, &filter_presets); } else if (ui->knownImports->currentText() == "Poseidon MkVI") { QPair<QString, QString> pair = poseidonFileNames(fileNames[i]); parse_txt_file(qPrintable(pair.second), qPrintable(pair.first), &table, &trips, &sites); @@ -932,7 +934,7 @@ void DiveLogImportDialog::on_buttonBox_accepted() pnr = setup_csv_params(r, params, pnr); parse_csv_file(qPrintable(fileNames[i]), params, pnr - 1, specialCSV.contains(ui->knownImports->currentIndex()) ? qPrintable(CSVApps[ui->knownImports->currentIndex()].name) : "csv", - &table, &trips, &sites); + &table, &trips, &sites, &filter_presets); } } } else { @@ -998,7 +1000,7 @@ void DiveLogImportDialog::on_buttonBox_accepted() params[pnr++] = intdup(r.indexOf(tr("Rating"))); params[pnr++] = NULL; - parse_manual_file(qPrintable(fileNames[i]), params, pnr - 1, &table, &trips, &sites); + parse_manual_file(qPrintable(fileNames[i]), params, pnr - 1, &table, &trips, &sites, &filter_presets); } else { char *params[53]; int pnr = 0; @@ -1015,7 +1017,7 @@ void DiveLogImportDialog::on_buttonBox_accepted() pnr = setup_csv_params(r, params, pnr); parse_csv_file(qPrintable(fileNames[i]), params, pnr - 1, specialCSV.contains(ui->knownImports->currentIndex()) ? qPrintable(CSVApps[ui->knownImports->currentIndex()].name) : "csv", - &table, &trips, &sites); + &table, &trips, &sites, &filter_presets); } } } diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 75f3abebf..d4bbc1384 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -530,7 +530,7 @@ void MainWindow::on_actionCloudstorageopen_triggered() showProgressBar(); QByteArray fileNamePtr = QFile::encodeName(filename); - if (!parse_file(fileNamePtr.data(), &dive_table, &trip_table, &dive_site_table)) + if (!parse_file(fileNamePtr.data(), &dive_table, &trip_table, &dive_site_table, &filter_preset_table)) setCurrentFile(fileNamePtr.data()); process_loaded_dives(); hideProgressBar(); @@ -1549,10 +1549,11 @@ void MainWindow::importFiles(const QStringList fileNames) struct dive_table table = empty_dive_table; struct trip_table trips = empty_trip_table; struct dive_site_table sites = empty_dive_site_table; + filter_preset_table_t filter_presets; for (int i = 0; i < fileNames.size(); ++i) { fileNamePtr = QFile::encodeName(fileNames.at(i)); - parse_file(fileNamePtr.data(), &table, &trips, &sites); + parse_file(fileNamePtr.data(), &table, &trips, &sites, &filter_presets); } QString source = fileNames.size() == 1 ? fileNames[0] : tr("multiple files"); Command::importDives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS, source); @@ -1569,7 +1570,7 @@ void MainWindow::loadFiles(const QStringList fileNames) showProgressBar(); for (int i = 0; i < fileNames.size(); ++i) { fileNamePtr = QFile::encodeName(fileNames.at(i)); - if (!parse_file(fileNamePtr.data(), &dive_table, &trip_table, &dive_site_table)) { + if (!parse_file(fileNamePtr.data(), &dive_table, &trip_table, &dive_site_table, &filter_preset_table)) { setCurrentFile(fileNamePtr.data()); addRecentFile(fileNamePtr, false); } @@ -1646,7 +1647,7 @@ void MainWindow::on_actionImportDiveSites_triggered() for (const QString &s: fileNames) { QByteArray fileNamePtr = QFile::encodeName(s); - parse_file(fileNamePtr.data(), &table, &trips, &sites); + parse_file(fileNamePtr.data(), &table, &trips, &sites, &filter_preset_table); } // The imported dive sites still have pointers to imported dives - remove them for (int i = 0; i < sites.nr; ++i) diff --git a/desktop-widgets/subsurfacewebservices.cpp b/desktop-widgets/subsurfacewebservices.cpp index fa5ee7164..fa1b003da 100644 --- a/desktop-widgets/subsurfacewebservices.cpp +++ b/desktop-widgets/subsurfacewebservices.cpp @@ -456,7 +456,8 @@ void DivelogsDeWebServices::buttonClicked(QAbstractButton *button) struct dive_table table = empty_dive_table; struct trip_table trips = empty_trip_table; struct dive_site_table sites = empty_dive_site_table; - parse_file(QFile::encodeName(zipFile.fileName()), &table, &trips, &sites); + filter_preset_table_t filter_presets; + parse_file(QFile::encodeName(zipFile.fileName()), &table, &trips, &sites, &filter_presets); Command::importDives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS, QStringLiteral("divelogs.de")); /* store last entered user/pass in config */ |