summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-11-10 18:28:20 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-11-10 18:28:20 (GMT)
commitbc1ce46fdabb0b30459cb1f7cda9fe225fa798ab (patch)
tree65c77ae341b7f1e58c2250e3f262315bb1c41e09
parentb58558ccd379258d3259e16cfe8fe3fe80fbaf66 (diff)
Ensure matching calls of qDeleteAll/clear. Code style fixes.
-rw-r--r--src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp b/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
index b1fc555..c2c7738 100644
--- a/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
+++ b/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
@@ -123,14 +123,19 @@ void GeoLineStringGraphicsItem::paint(GeoPainter* painter, const ViewportParams*
setRenderContext(RenderContext(tileLevel));
if (layer.endsWith(QLatin1String("/outline"))) {
+ qDeleteAll(m_cachedPolygons);
m_cachedPolygons.clear();
painter->polygonsFromLineString(*m_renderLineString, m_cachedPolygons);
- if (m_cachedPolygons.empty()) return;
+ if (m_cachedPolygons.empty()) {
+ return;
+ }
if (painter->mapQuality() == HighQuality || painter->mapQuality() == PrintQuality) {
paintOutline(painter, viewport, m_cachedPolygons);
}
} else if (layer.endsWith(QLatin1String("/inline"))) {
- if (m_cachedPolygons.empty()) return;
+ if (m_cachedPolygons.empty()) {
+ return;
+ }
paintInline(painter, viewport, m_cachedPolygons);
} else if (layer.endsWith(QLatin1String("/label"))) {
if (!m_cachedPolygons.empty()) {
@@ -139,14 +144,19 @@ void GeoLineStringGraphicsItem::paint(GeoPainter* painter, const ViewportParams*
}
}
qDeleteAll(m_cachedPolygons);
+ m_cachedPolygons.clear();
} else {
+ qDeleteAll(m_cachedPolygons);
m_cachedPolygons.clear();
painter->polygonsFromLineString(*m_renderLineString, m_cachedPolygons);
- if (m_cachedPolygons.empty()) return;
+ if (m_cachedPolygons.empty()) {
+ return;
+ }
foreach(const QPolygonF* itPolygon, m_cachedPolygons) {
painter->drawPolyline(*itPolygon);
}
qDeleteAll(m_cachedPolygons);
+ m_cachedPolygons.clear();
}
}