mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
fadea413cd
commit
39a4090c0a
17 changed files with 113 additions and 40 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue