diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-11-22 08:06:07 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-11-23 13:22:24 -0800 |
commit | 9e565e355221d38c05d19002f040d6af7ce07735 (patch) | |
tree | bf55a546433dfff3c1ed9058b0ce6b254d33c70d /core/dive.h | |
parent | fba6ec5ad500f0106a1590f061a583376dcbd23d (diff) | |
download | subsurface-9e565e355221d38c05d19002f040d6af7ce07735.tar.gz |
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/dive.h')
-rw-r--r-- | core/dive.h | 14 |
1 files changed, 10 insertions, 4 deletions
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 |