summaryrefslogtreecommitdiffstats
path: root/qt-models/diveimportedmodel.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-01-13 10:58:04 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-01-19 13:48:17 -0800
commitff9506b21bbb9910256841dcb577bcb2e19047e8 (patch)
treec0bfa63b27ca32fc6d8c223531d5beff6fbb95fe /qt-models/diveimportedmodel.cpp
parent1cd0863cca678cf54dfa8a71f3ca9f94bfc4f693 (diff)
downloadsubsurface-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 'qt-models/diveimportedmodel.cpp')
-rw-r--r--qt-models/diveimportedmodel.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/qt-models/diveimportedmodel.cpp b/qt-models/diveimportedmodel.cpp
index ff93e1792..59fe9b12b 100644
--- a/qt-models/diveimportedmodel.cpp
+++ b/qt-models/diveimportedmodel.cpp
@@ -127,12 +127,11 @@ void DiveImportedModel::clearTable()
endRemoveRows();
}
-void DiveImportedModel::repopulate(dive_table_t *table, trip_table_t *trips)
+void DiveImportedModel::repopulate(dive_table_t *table)
{
beginResetModel();
diveTable = table;
- tripTable = trips;
firstIndex = 0;
lastIndex = diveTable->nr - 1;
checkStates.resize(diveTable->nr);
@@ -159,7 +158,7 @@ void DiveImportedModel::recordDives()
}
// TODO: Might want to let the user select "add_to_new_trip"
- add_imported_dives(diveTable, tripTable, true, true, false, false);
+ add_imported_dives(diveTable, nullptr, true, true, false, false);
}
QHash<int, QByteArray> DiveImportedModel::roleNames() const {