diff options
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/divelogimportdialog.cpp | 12 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 10 | ||||
-rw-r--r-- | desktop-widgets/subsurfacewebservices.cpp | 4 |
3 files changed, 16 insertions, 10 deletions
diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp index eccdd2264..e6243e98d 100644 --- a/desktop-widgets/divelogimportdialog.cpp +++ b/desktop-widgets/divelogimportdialog.cpp @@ -13,6 +13,7 @@ #include "core/filterpreset.h" #include "core/qthelper.h" #include "core/divesite.h" +#include "core/device.h" #include "core/trip.h" #include "core/import-csv.h" #include "core/xmlparams.h" @@ -880,15 +881,16 @@ 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; + struct device_table devices; struct filter_preset_table 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, &filter_presets); + parse_seabear_log(qPrintable(fileNames[i]), &table, &trips, &sites, &devices, &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); + parse_txt_file(qPrintable(pair.second), qPrintable(pair.first), &table, &trips, &sites, &devices); } else { xml_params params; @@ -902,7 +904,7 @@ void DiveLogImportDialog::on_buttonBox_accepted() setup_csv_params(r, params); parse_csv_file(qPrintable(fileNames[i]), ¶ms, specialCSV.contains(ui->knownImports->currentIndex()) ? qPrintable(CSVApps[ui->knownImports->currentIndex()].name) : "csv", - &table, &trips, &sites, &filter_presets); + &table, &trips, &sites, &devices, &filter_presets); } } } else { @@ -938,7 +940,7 @@ void DiveLogImportDialog::on_buttonBox_accepted() xml_params_add_int(¶ms, "visibilityField", r.indexOf(tr("Visibility"))); xml_params_add_int(¶ms, "ratingField", r.indexOf(tr("Rating"))); - parse_manual_file(qPrintable(fileNames[i]), ¶ms, &table, &trips, &sites, &filter_presets); + parse_manual_file(qPrintable(fileNames[i]), ¶ms, &table, &trips, &sites, &devices, &filter_presets); } else { xml_params params; @@ -952,7 +954,7 @@ void DiveLogImportDialog::on_buttonBox_accepted() setup_csv_params(r, params); parse_csv_file(qPrintable(fileNames[i]), ¶ms, specialCSV.contains(ui->knownImports->currentIndex()) ? qPrintable(CSVApps[ui->knownImports->currentIndex()].name) : "csv", - &table, &trips, &sites, &filter_presets); + &table, &trips, &sites, &devices, &filter_presets); } } } diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 14619abae..327eb0578 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, &filter_preset_table)) + if (!parse_file(fileNamePtr.data(), &dive_table, &trip_table, &dive_site_table, &device_table, &filter_preset_table)) setCurrentFile(fileNamePtr.data()); process_loaded_dives(); hideProgressBar(); @@ -1549,11 +1549,12 @@ 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; + struct device_table devices; struct filter_preset_table filter_presets; for (int i = 0; i < fileNames.size(); ++i) { fileNamePtr = QFile::encodeName(fileNames.at(i)); - parse_file(fileNamePtr.data(), &table, &trips, &sites, &filter_presets); + parse_file(fileNamePtr.data(), &table, &trips, &sites, &devices, &filter_presets); } QString source = fileNames.size() == 1 ? fileNames[0] : tr("multiple files"); Command::importDives(&table, &trips, &sites, &filter_presets, IMPORT_MERGE_ALL_TRIPS, source); @@ -1570,7 +1571,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, &filter_preset_table)) { + if (!parse_file(fileNamePtr.data(), &dive_table, &trip_table, &dive_site_table, &device_table, &filter_preset_table)) { setCurrentFile(fileNamePtr.data()); addRecentFile(fileNamePtr, false); } @@ -1644,11 +1645,12 @@ 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 device_table devices; struct filter_preset_table filter_presets; for (const QString &s: fileNames) { QByteArray fileNamePtr = QFile::encodeName(s); - parse_file(fileNamePtr.data(), &table, &trips, &sites, &filter_presets); + parse_file(fileNamePtr.data(), &table, &trips, &sites, &devices, &filter_presets); } // 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 bc4c4745d..c5a5cad48 100644 --- a/desktop-widgets/subsurfacewebservices.cpp +++ b/desktop-widgets/subsurfacewebservices.cpp @@ -5,6 +5,7 @@ #include "core/settings/qPrefCloudStorage.h" #include "desktop-widgets/mainwindow.h" #include "commands/command.h" +#include "core/device.h" #include "core/divesite.h" #include "core/trip.h" #include "core/errorhelper.h" @@ -456,8 +457,9 @@ 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; + struct device_table devices; struct filter_preset_table filter_presets; - parse_file(QFile::encodeName(zipFile.fileName()), &table, &trips, &sites, &filter_presets); + parse_file(QFile::encodeName(zipFile.fileName()), &table, &trips, &sites, &devices, &filter_presets); Command::importDives(&table, &trips, &sites, nullptr, IMPORT_MERGE_ALL_TRIPS, QStringLiteral("divelogs.de")); /* store last entered user/pass in config */ |