diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-05-28 11:48:30 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-05-28 11:54:33 -0700 |
commit | 3f0d21046e92701de200a00f12bde20a7ad3a55c (patch) | |
tree | d5b4134865a3153da692c913aa7f829f08ad8bd0 /qt-models/diveimportedmodel.cpp | |
parent | 84b1b63d46e4868808cc8dbd1c4fef8078ddcb16 (diff) | |
download | subsurface-3f0d21046e92701de200a00f12bde20a7ad3a55c.tar.gz |
QML UI: add downloaded dives to dive list
This already takes into account which of those dives were selected.
Right now all we have is select all or none - this needs actual support
in the UI, but once that's there, it will just work (famous last words).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/diveimportedmodel.cpp')
-rw-r--r-- | qt-models/diveimportedmodel.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-models/diveimportedmodel.cpp b/qt-models/diveimportedmodel.cpp index 781cd72c6..c1f4f7525 100644 --- a/qt-models/diveimportedmodel.cpp +++ b/qt-models/diveimportedmodel.cpp @@ -143,6 +143,17 @@ void DiveImportedModel::repopulate() setImportedDivesIndexes(0, diveTable->nr-1); } +void DiveImportedModel::recordDives() +{ + for (int i = 0; i < rowCount(); i++) { + if (diveTable->dives[i] && checkStates[i]) { + record_dive(diveTable->dives[i]); + diveTable->dives[i] = NULL; + } + } + diveTable->nr = 0; +} + QHash<int, QByteArray> DiveImportedModel::roleNames() const { static QHash<int, QByteArray> roles = { { DateTime, "datetime"}, |