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:
Berthold Stoeger 2018-10-24 16:34:43 +02:00 committed by Dirk Hohndel
parent d674c5028f
commit ab29f6416b
3 changed files with 4 additions and 4 deletions

View file

@ -84,7 +84,7 @@ void LocationInformationWidget::mergeSelectedDiveSites()
std::vector<struct dive_site *> selected_dive_sites;
selected_dive_sites.reserve(selection.count());
Q_FOREACH (const QModelIndex &idx, selection) {
struct dive_site *ds = get_dive_site_by_uuid(idx.data(LocationInformationModel::UUID_ROLE).toUInt());
struct dive_site *ds = (struct dive_site *)idx.data(LocationInformationModel::DIVESITE_ROLE).value<void *>();
if (ds)
selected_dive_sites.push_back(ds);
}