summaryrefslogtreecommitdiffstats
path: root/src/imports/location/qdeclarativepolygonmapitem.cpp
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@jollamobile.com>2015-09-01 16:20:25 +1000
committerAaron McCarthy <mccarthy.aaron@gmail.com>2015-09-02 01:38:47 +0000
commit2898098f65d1ddb5f4ceeedac06786c2cda8a611 (patch)
treeb027df1a31554918075df31ea56aecfc7808b89e /src/imports/location/qdeclarativepolygonmapitem.cpp
parentfd3ea87861b281a54c1888a0a044517cf86f9692 (diff)
Remove incorrect string construction in QML debug output
The original string had a "%1" expecting to be replaced by the arg() function, which was not used. Removed the output altogether, silently do nothing if the coordinate is not in the path. Remove dead code trusting that QList::lastIndexOf() will returned -1 or a valid index. Change-Id: Iffa7e663a439696cff6a6aa73d714f1259f4ea69 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/imports/location/qdeclarativepolygonmapitem.cpp')
-rw-r--r--src/imports/location/qdeclarativepolygonmapitem.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/imports/location/qdeclarativepolygonmapitem.cpp b/src/imports/location/qdeclarativepolygonmapitem.cpp
index 5b94d009..9a71614f 100644
--- a/src/imports/location/qdeclarativepolygonmapitem.cpp
+++ b/src/imports/location/qdeclarativepolygonmapitem.cpp
@@ -448,26 +448,19 @@ void QDeclarativePolygonMapItem::addCoordinate(const QGeoCoordinate &coordinate)
/*!
\qmlmethod void MapPolygon::removeCoordinate(coordinate)
- Removes a coordinate from the path. If there are multiple instances of the
+ Removes \a coordinate from the path. If there are multiple instances of the
same coordinate, the one added last is removed.
- \sa addCoordinate, path
+ If \a coordinate is not in the path this method does nothing.
+ \sa addCoordinate, path
*/
-
void QDeclarativePolygonMapItem::removeCoordinate(const QGeoCoordinate &coordinate)
{
int index = path_.lastIndexOf(coordinate);
-
- if (index == -1) {
- qmlInfo(this) << COORD_NOT_BELONG_TO << QStringLiteral("PolygonMapItem");
+ if (index == -1)
return;
- }
- if (path_.count() < index + 1) {
- qmlInfo(this) << COORD_NOT_BELONG_TO << QStringLiteral("PolygonMapItem");
- return;
- }
path_.removeAt(index);
geometry_.markSourceDirty();