From f6e269c07a163c7c53e7d1cb405e39b51322b062 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Thu, 27 Jul 2017 23:08:46 +0300 Subject: maplocationmodel: fix getMapLocationForUuid() This method did not return NULL properly if a MapLocation does not exists in the list. Signed-off-by: Lubomir I. Ivanov --- qt-models/maplocationmodel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qt-models/maplocationmodel.cpp b/qt-models/maplocationmodel.cpp index 3a8db96d4..bc53d6c0b 100644 --- a/qt-models/maplocationmodel.cpp +++ b/qt-models/maplocationmodel.cpp @@ -129,10 +129,10 @@ quint32 MapLocationModel::selectedUuid() MapLocation *MapLocationModel::getMapLocationForUuid(quint32 uuid) { - MapLocation *location = NULL; + MapLocation *location; foreach(location, m_mapLocations) { - if (location->getRole(MapLocation::Roles::RoleUuid) == uuid) - break; + if (uuid == location->uuid()) + return location; } - return location; + return NULL; } -- cgit v1.2.3-70-g09d2