diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-10-28 21:16:42 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-29 00:09:31 +0000 |
commit | 920eb7576ff3c5fab19c12b7b291042817422ac5 (patch) | |
tree | 10af74e93306ea0e3577b30ea9704545185462e6 /core/divesite.h | |
parent | e8b3fdb4a6936c1130395e039963839d64f2b396 (diff) | |
download | subsurface-920eb7576ff3c5fab19c12b7b291042817422ac5.tar.gz |
Dive site: pass pointer-to-dive_site via QVariant
There was this ugly pattern of passing pointers-to-dive_site via
a QVariant of void * type. This is of course inherently unsafe.
Pass these pointers using their proper types instead. This makes
it necessary to register them in Qt's meta-type system. Doing so,
fixes a bug: QML couldn't call into updateDiveSiteCoordinates()
because it didn't know the type and thus the coordinates of
the moved flag were not reflected in the divesite-dialog.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/divesite.h')
-rw-r--r-- | core/divesite.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/divesite.h b/core/divesite.h index 895412a4b..3ce87128a 100644 --- a/core/divesite.h +++ b/core/divesite.h @@ -78,6 +78,9 @@ void merge_dive_sites(struct dive_site *ref, struct dive_site *dive_sites[], int } QString constructLocationTags(struct taxonomy_data *taxonomy, bool for_maintab); +/* Make pointer-to-dive_site a "Qt metatype" so that we can pass it through QVariants */ +Q_DECLARE_METATYPE(dive_site *); + #endif #endif // DIVESITE_H |