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>
This commit is contained in:
Berthold Stoeger 2018-11-22 08:06:07 +01:00 committed by Dirk Hohndel
parent fba6ec5ad5
commit 9e565e3552
4 changed files with 33 additions and 29 deletions

View file

@ -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