From 9e565e355221d38c05d19002f040d6af7ce07735 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 22 Nov 2018 08:06:07 +0100 Subject: Cleanup: make "struct dive *" and "struct dive_trip *" Qt metatypes Just as we did for pointer to struct dive_site, make pointers to struct dive and struct dive_trip "Qt metatypes". This means that they can be passed through QVariants without taking a detour via void *. Signed-off-by: Berthold Stoeger --- core/dive.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/dive.h b/core/dive.h index 8b98d3b49..eff04ba23 100644 --- a/core/dive.h +++ b/core/dive.h @@ -758,10 +758,6 @@ extern void set_git_prefs(const char *prefs); extern char *get_dive_date_c_string(timestamp_t when); extern void update_setpoint_events(const struct dive *dive, struct divecomputer *dc); -#ifdef __cplusplus -} -#endif - extern weight_t string_to_weight(const char *str); extern depth_t string_to_depth(const char *str); extern pressure_t string_to_pressure(const char *str); @@ -769,6 +765,16 @@ extern volume_t string_to_volume(const char *str, pressure_t workp); extern fraction_t string_to_fraction(const char *str); extern void average_max_depth(struct diveplan *dive, int *avg_depth, int *max_depth); +#ifdef __cplusplus +} + +/* Make pointers to dive and dive_trip "Qt metatypes" so that they can + * be passed through QVariants. */ +Q_DECLARE_METATYPE(struct dive *); +Q_DECLARE_METATYPE(struct dive_trip *); + +#endif + #include "pref.h" #endif // DIVE_H -- cgit v1.2.3-70-g09d2