summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/divelogimportdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/divelogimportdialog.cpp')
-rw-r--r--desktop-widgets/divelogimportdialog.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp
index 09bb6c535..251f87587 100644
--- a/desktop-widgets/divelogimportdialog.cpp
+++ b/desktop-widgets/divelogimportdialog.cpp
@@ -900,14 +900,15 @@ int DiveLogImportDialog::parseTxtHeader(QString fileName, char **params, int pnr
void DiveLogImportDialog::on_buttonBox_accepted()
{
struct dive_table table = { 0 };
+ struct trip_table trips = { 0 };
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, &trip_table);
+ parse_seabear_log(qPrintable(fileNames[i]), &table, &trips);
} else if (ui->knownImports->currentText() == "Poseidon MkVI") {
QPair<QString, QString> pair = poseidonFileNames(fileNames[i]);
- parse_txt_file(qPrintable(pair.second), qPrintable(pair.first), &table, &trip_table);
+ parse_txt_file(qPrintable(pair.second), qPrintable(pair.first), &table, &trips);
} else {
char *params[49];
int pnr = 0;
@@ -924,7 +925,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, &trip_table);
+ &table, &trips);
}
}
} else {
@@ -988,7 +989,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, &trip_table);
+ parse_manual_file(qPrintable(fileNames[i]), params, pnr - 1, &table, &trips);
} else {
char *params[51];
int pnr = 0;
@@ -1005,12 +1006,12 @@ 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, &trip_table);
+ &table, &trips);
}
}
}
- process_imported_dives(&table, false, false);
+ process_imported_dives(&table, &trips, false, false);
Command::clear();
MainWindow::instance()->refreshDisplay();
}