diff options
-rw-r--r-- | qt-models/maplocationmodel.cpp | 7 | ||||
-rw-r--r-- | qt-models/maplocationmodel.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/qt-models/maplocationmodel.cpp b/qt-models/maplocationmodel.cpp index e01b46621..5ae3609e3 100644 --- a/qt-models/maplocationmodel.cpp +++ b/qt-models/maplocationmodel.cpp @@ -101,10 +101,15 @@ quint32 MapLocationModel::selectedUuid() void MapLocationModel::setSelectedUuid(quint32 uuid)
{
m_selectedUuid = uuid;
+ emit selectedLocationChanged(getMapLocationForUuid(uuid));
+}
+
+MapLocation *MapLocationModel::getMapLocationForUuid(quint32 uuid)
+{
MapLocation *location = NULL;
foreach(location, m_mapLocations) {
if (location->getRole(MapLocation::Roles::RoleUuid) == uuid)
break;
}
- emit selectedLocationChanged(location);
+ return location;
}
diff --git a/qt-models/maplocationmodel.h b/qt-models/maplocationmodel.h index 7a1730653..ea720b983 100644 --- a/qt-models/maplocationmodel.h +++ b/qt-models/maplocationmodel.h @@ -52,6 +52,7 @@ public: void add(MapLocation *); void addList(QVector<MapLocation *>); void clear(); + MapLocation *getMapLocationForUuid(quint32 uuid); protected: QHash<int, QByteArray> roleNames() const; |