diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-12-23 12:46:25 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-01-09 20:58:04 -0800 |
commit | f542dc4030dda5dac1da1cc928f7a40a50919c4d (patch) | |
tree | eb7f77bc9701c3180082da7f0435b9d467c565e7 /core/dive.h | |
parent | 7e33369dc8b27b20385ab055b662e06bbf369784 (diff) | |
download | subsurface-f542dc4030dda5dac1da1cc928f7a40a50919c4d.tar.gz |
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>
Diffstat (limited to 'core/dive.h')
-rw-r--r-- | core/dive.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/dive.h b/core/dive.h index f7cf060b7..b13d16e57 100644 --- a/core/dive.h +++ b/core/dive.h @@ -288,10 +288,10 @@ typedef struct dive_trip bool autogen; } dive_trip_t; -struct trip_table { +typedef struct trip_table { int nr, allocated; struct dive_trip **trips; -}; +} trip_table_t; struct picture; struct dive { @@ -762,10 +762,11 @@ extern void average_max_depth(struct diveplan *dive, int *avg_depth, int *max_de * be passed through QVariants and through QML. * Note: we have to use the typedef "dive_table_t" instead of "struct dive_table", * because MOC removes the "struct", but dive_table is already the name of a global - * variable, leading to compilation errors. */ + * variable, leading to compilation errors. Likewise for "struct trip_table". */ Q_DECLARE_METATYPE(struct dive *); Q_DECLARE_METATYPE(struct dive_trip *); Q_DECLARE_METATYPE(dive_table_t *); +Q_DECLARE_METATYPE(trip_table_t *); #endif |