diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-02-28 22:45:17 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | 37146c5742503becf75468fb07aab56011cb9101 (patch) | |
tree | 666e4d609b3d9b882082fcc258d6d153c6c68fa5 /desktop-widgets/divelogimportdialog.cpp | |
parent | 926b6895bbce7cc539ca4d0c3a425876dfa33d6b (diff) | |
download | subsurface-37146c5742503becf75468fb07aab56011cb9101.tar.gz |
Parser: parse into custom dive site table
To extend the undo system to dive sites, the importers and downloaders
must not parse directly into the global dive site table. Instead,
pass a dive_site_table argument to parse into.
For now, always pass the global dive_site_table so that this commit
should not cause any functional change.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/divelogimportdialog.cpp')
-rw-r--r-- | desktop-widgets/divelogimportdialog.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp index 6965da06c..f1e616514 100644 --- a/desktop-widgets/divelogimportdialog.cpp +++ b/desktop-widgets/divelogimportdialog.cpp @@ -905,10 +905,10 @@ void DiveLogImportDialog::on_buttonBox_accepted() 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); + parse_seabear_log(qPrintable(fileNames[i]), &table, &trips, &dive_site_table); } 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); + parse_txt_file(qPrintable(pair.second), qPrintable(pair.first), &table, &trips, &dive_site_table); } else { char *params[49]; int pnr = 0; @@ -925,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, &trips); + &table, &trips, &dive_site_table); } } } else { @@ -989,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, &trips); + parse_manual_file(qPrintable(fileNames[i]), params, pnr - 1, &table, &trips, &dive_site_table); } else { char *params[51]; int pnr = 0; @@ -1006,7 +1006,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); + &table, &trips, &dive_site_table); } } } @@ -1019,7 +1019,7 @@ TagDragDelegate::TagDragDelegate(QObject *parent) : QStyledItemDelegate(parent) { } -QSize TagDragDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const +QSize TagDragDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const { QSize originalSize = QStyledItemDelegate::sizeHint(option, index); return originalSize + QSize(5,5); |