summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/dive.h7
-rw-r--r--core/downloadfromdcthread.cpp6
-rw-r--r--core/downloadfromdcthread.h2
3 files changed, 12 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
diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp
index 2fdebf129..adcdea02b 100644
--- a/core/downloadfromdcthread.cpp
+++ b/core/downloadfromdcthread.cpp
@@ -307,6 +307,12 @@ struct dive_table *DownloadThread::table()
return &downloadTable;
}
+struct trip_table *DownloadThread::trips()
+{
+ // TODO: Replace by local trip-table
+ return &trip_table;
+}
+
QString DCDeviceData::vendor() const
{
return data.vendor;
diff --git a/core/downloadfromdcthread.h b/core/downloadfromdcthread.h
index b380a88a1..426a807d9 100644
--- a/core/downloadfromdcthread.h
+++ b/core/downloadfromdcthread.h
@@ -61,6 +61,7 @@ private:
class DownloadThread : public QThread {
Q_OBJECT
Q_PROPERTY(dive_table_t *table READ table CONSTANT)
+ Q_PROPERTY(trip_table_t *trips READ trips CONSTANT)
public:
DownloadThread();
@@ -68,6 +69,7 @@ public:
DCDeviceData *data();
struct dive_table *table();
+ struct trip_table *trips();
QString error;
private: