summaryrefslogtreecommitdiffstats
path: root/qt-models/diveimportedmodel.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-10-17 16:07:39 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-24 09:51:37 -0700
commit39a4090c0a6e1d8fe12516be06ee7b31dd4bc96d (patch)
tree7587930b64bf95ec3a652cf761e6ded573931364 /qt-models/diveimportedmodel.h
parentfadea413cdb4644b821369b27fad6e5f019d32c2 (diff)
downloadsubsurface-39a4090c0a6e1d8fe12516be06ee7b31dd4bc96d.tar.gz
devices: add devices in Command::importTable()
Add a device_table parameters to Command::importTable() and add_imported_dives(). The content of this table will be added to the global device list (respectively removed on undo). This is currently a no-op, as the parser doesn't yet fill out the device table, but adds devices directly to the global device table. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/diveimportedmodel.h')
-rw-r--r--qt-models/diveimportedmodel.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/qt-models/diveimportedmodel.h b/qt-models/diveimportedmodel.h
index 920bd57c6..f43057d26 100644
--- a/qt-models/diveimportedmodel.h
+++ b/qt-models/diveimportedmodel.h
@@ -1,11 +1,11 @@
#ifndef DIVEIMPORTEDMODEL_H
#define DIVEIMPORTEDMODEL_H
-#include <QAbstractTableModel>
-#include <vector>
+#include "core/device.h"
#include "core/divesite.h"
#include "core/divelist.h"
#include "core/downloadfromdcthread.h"
+#include <QAbstractTableModel>
class DiveImportedModel : public QAbstractTableModel
{
@@ -23,7 +23,7 @@ public:
Q_INVOKABLE void clearTable();
QHash<int, QByteArray> roleNames() const;
void deleteDeselected();
- std::pair<struct dive_table, struct dive_site_table> consumeTables(); // Returns dives and sites and resets model.
+ std::tuple<struct dive_table, struct dive_site_table, struct device_table> consumeTables(); // Returns downloaded tables and resets model.
int numDives() const;
Q_INVOKABLE void recordDives(int flags = IMPORT_PREFER_IMPORTED | IMPORT_IS_DOWNLOADED);
@@ -48,6 +48,7 @@ private:
std::vector<char> checkStates; // char instead of bool to avoid silly pessimization of std::vector.
struct dive_table diveTable;
struct dive_site_table sitesTable;
+ struct device_table deviceTable;
};
#endif