diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-01-13 10:58:04 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-01-19 13:48:17 -0800 |
commit | ff9506b21bbb9910256841dcb577bcb2e19047e8 (patch) | |
tree | c0bfa63b27ca32fc6d8c223531d5beff6fbb95fe /desktop-widgets/downloadfromdivecomputer.cpp | |
parent | 1cd0863cca678cf54dfa8a71f3ca9f94bfc4f693 (diff) | |
download | subsurface-ff9506b21bbb9910256841dcb577bcb2e19047e8.tar.gz |
Import: don't add to new trip while downloading
Since process_imported_dives() can add dives to a newly generated
trip, this need not be done in the downloading code. This makes
data flow distinctly simpler, as no trip table and no add-new-trip
flag has to be passed down to the libdivecomputer glue code.
Moreover, since now the trip creation is done at the import step
rather than the download step, the latest status of the "add to
new trip" checkbox will be considered.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/downloadfromdivecomputer.cpp')
-rw-r--r-- | desktop-widgets/downloadfromdivecomputer.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp index a3bc6287c..3376d5c39 100644 --- a/desktop-widgets/downloadfromdivecomputer.cpp +++ b/desktop-widgets/downloadfromdivecomputer.cpp @@ -384,7 +384,6 @@ void DownloadFromDCWidget::on_downloadCancelRetryButton_clicked() } data->setForceDownload(ui.forceDownload->isChecked()); - data->setCreateNewTrip(ui.createNewTrip->isChecked()); data->setSaveLog(ui.logToFile->isChecked()); data->setSaveDump(ui.dumpToFile->isChecked()); @@ -486,7 +485,7 @@ void DownloadFromDCWidget::onDownloadThreadFinished() } ui.downloadCancelRetryButton->setText(tr("Retry download")); ui.downloadCancelRetryButton->setEnabled(true); - diveImportedModel->repopulate(thread.table(), thread.trips()); + diveImportedModel->repopulate(thread.table()); } void DownloadFromDCWidget::on_cancel_clicked() @@ -504,7 +503,6 @@ void DownloadFromDCWidget::on_ok_clicked() if (currentState != DONE && currentState != ERROR) return; struct dive_table *table = thread.table(); - struct trip_table *trips = thread.trips(); // delete non-selected dives int total = table->nr; @@ -518,7 +516,7 @@ void DownloadFromDCWidget::on_ok_clicked() if (table->nr > 0) { auto data = thread.data(); - Command::importDives(table, trips, preferDownloaded(), true, false, ui.createNewTrip->isChecked(), data->devName()); + Command::importDives(table, nullptr, preferDownloaded(), true, false, ui.createNewTrip->isChecked(), data->devName()); } if (ostcFirmwareCheck && currentState == DONE) |