summaryrefslogtreecommitdiffstats
path: root/qt-models/maplocationmodel.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-07-27 23:08:46 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-28 07:31:11 -0700
commitf6e269c07a163c7c53e7d1cb405e39b51322b062 (patch)
treec98993c5f8c2c206dc0bec0db6fdd9ef3e472ac3 /qt-models/maplocationmodel.cpp
parent0955a5b36a5d67454826a0a2fe58d609486faaaa (diff)
downloadsubsurface-f6e269c07a163c7c53e7d1cb405e39b51322b062.tar.gz
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 <neolit123@gmail.com>
Diffstat (limited to 'qt-models/maplocationmodel.cpp')
-rw-r--r--qt-models/maplocationmodel.cpp8
1 files 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;
}