mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive site: replace UUID_ROLE by DIVESITE_ROLE
Access to dive-sites in the LocationInformationModel was via UUID. Replace this by a direct access to the struct dive_site pointer. Accordingly, rename the UUID_ROLE to DIVESITE_ROLE. This is a small step in replacing dive-site UUIDs by pointers throughout the code base. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
d674c5028f
commit
ab29f6416b
3 changed files with 4 additions and 4 deletions
|
@ -59,8 +59,8 @@ QVariant LocationInformationModel::getDiveSiteData(const struct dive_site *ds, i
|
|||
else
|
||||
return QVariant();
|
||||
}
|
||||
case UUID_ROLE:
|
||||
return ds->uuid;
|
||||
case DIVESITE_ROLE:
|
||||
return QVariant::fromValue<void *>((void *)ds); // Not nice: casting away const
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public:
|
|||
// Common columns, roles and accessor function for all dive-site models.
|
||||
// Thus, different views can connect to different models.
|
||||
enum Columns { UUID, NAME, LATITUDE, LONGITUDE, COORDS, DESCRIPTION, NOTES, TAXONOMY_1, TAXONOMY_2, TAXONOMY_3, COLUMNS};
|
||||
enum Roles { UUID_ROLE = Qt::UserRole + 1 };
|
||||
enum Roles { DIVESITE_ROLE = Qt::UserRole + 1 };
|
||||
static QVariant getDiveSiteData(const struct dive_site *ds, int column, int role);
|
||||
|
||||
LocationInformationModel(QObject *obj = 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue