summaryrefslogtreecommitdiffstats
path: root/core/dive.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-03-04 23:20:29 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-12 18:19:07 +0300
commitc22fd9f4fd6699333629b8acb1e9c135a9783082 (patch)
tree7fad8249eb4fb3fa2797329716b1038d115a62d9 /core/dive.h
parentf2cdca7bccfcdfa04639600689b2b13b38b56898 (diff)
downloadsubsurface-c22fd9f4fd6699333629b8acb1e9c135a9783082.tar.gz
Dive sites: prepare for dive site ref-counting
Add a dive site table to each dive site to keep track of dives that have been added to a dive site. Add two functions to add dives to / remove dives from dive sites. Since dive sites now contain a dive table, the order of includes had to be changed: "divesite.h" now includes "dive.h" and not vice-versa. This caused some include churn. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/dive.h')
-rw-r--r--core/dive.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/dive.h b/core/dive.h
index fd03bc4ae..7c41f6c73 100644
--- a/core/dive.h
+++ b/core/dive.h
@@ -12,7 +12,6 @@
#include <zip.h>
#include <string.h>
#include <sys/stat.h>
-#include "divesite.h"
#include "units.h"
@@ -289,6 +288,8 @@ typedef struct trip_table {
} trip_table_t;
struct picture;
+struct dive_site;
+struct dive_site_table;
struct dive {
int number;
bool notrip; /* Don't autogroup this dive to a trip */
@@ -747,12 +748,12 @@ extern void average_max_depth(struct diveplan *dive, int *avg_depth, int *max_de
* 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. Likewise for "struct trip_table" and
- * "struct dive_site_table". */
+ * "struct dive_site_table" (defined in "divesite.h"). */
+#include <QObject>
Q_DECLARE_METATYPE(struct dive *);
Q_DECLARE_METATYPE(struct dive_trip *);
Q_DECLARE_METATYPE(dive_table_t *);
Q_DECLARE_METATYPE(trip_table_t *);
-Q_DECLARE_METATYPE(dive_site_table_t *);
#endif