mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Import: add trip_table argument to DiveImportedModel::repopulate()
In the future we want to download trips into a distinct trip-table instead of the global trip-table to allow for undo of import. Therefore add a trip_table argument to DiveImportedModel::repopulate() and a trip_table member to DiveImportedModel. To correctly set these, add a DownloadThread::trips() function, which currently simply returns the global trip table. Finally, make "struct trip_table *" a Q_METATYPE, so that the corresponding arguments can be passed from QML. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
7e33369dc8
commit
f542dc4030
7 changed files with 18 additions and 7 deletions
|
|
@ -20,7 +20,7 @@ public:
|
|||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
Q_INVOKABLE void clearTable();
|
||||
QHash<int, QByteArray> roleNames() const;
|
||||
Q_INVOKABLE void repopulate(dive_table_t *table);
|
||||
Q_INVOKABLE void repopulate(dive_table_t *table, trip_table_t *trips);
|
||||
Q_INVOKABLE void recordDives();
|
||||
public
|
||||
slots:
|
||||
|
|
@ -34,6 +34,7 @@ private:
|
|||
int lastIndex;
|
||||
std::vector<char> checkStates; // char instead of bool to avoid silly pessimization of std::vector.
|
||||
struct dive_table *diveTable;
|
||||
struct trip_table *tripTable;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue