summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-08-21 11:00:56 (GMT)
committerBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-08-27 10:03:53 (GMT)
commitbc13e500f7a12d14e6d5300591964882e1d53a9b (patch)
treeaf62f8199067f9003bfae32e8ac6525138539059
parent8938f293ff132e9a680f4715b7edd36b9750c3c5 (diff)
--code duplication
-rw-r--r--src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp b/src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp
index e3f1be6..382f05b 100644
--- a/src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp
+++ b/src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp
@@ -46,15 +46,13 @@ GeoPolygonGraphicsItem::GeoPolygonGraphicsItem(const GeoDataFeature *feature, co
paintLayers << QString("Polygon/Building/roof");
setPaintLayers(paintLayers);
}
- else if (visualCategory == GeoDataFeature::Bathymetry) {
- int elevation = extractBathymetryElevation(feature);
- setZValue(this->zValue() + elevation);
- const QString paintLayer = QLatin1String("Polygon/") + StyleBuilder::visualCategoryName(visualCategory);
- setPaintLayers(QStringList() << paintLayer);
- }
- else
- {
- const QString paintLayer = QLatin1String("Polygon/") + StyleBuilder::visualCategoryName(visualCategory);
+ else {
+ if (visualCategory == GeoDataFeature::Bathymetry) {
+ const int elevation = extractBathymetryElevation(feature);
+ setZValue(zValue() + elevation);
+ }
+
+ const QString paintLayer = QLatin1String("Polygon/%1") + StyleBuilder::visualCategoryName(visualCategory);
setPaintLayers(QStringList() << paintLayer);
}
}
@@ -78,15 +76,13 @@ GeoPolygonGraphicsItem::GeoPolygonGraphicsItem(const GeoDataFeature *feature, co
paintLayers << QString("Polygon/Building/roof");
setPaintLayers(paintLayers);
}
- else if (visualCategory == GeoDataFeature::Bathymetry) {
- int elevation = extractBathymetryElevation(feature);
- setZValue(this->zValue() + elevation);
- const QString paintLayer = QLatin1String("Polygon/") + StyleBuilder::visualCategoryName(visualCategory);
- setPaintLayers(QStringList() << paintLayer);
- }
- else
- {
- const QString paintLayer = QLatin1String("Polygon/") + StyleBuilder::visualCategoryName(visualCategory);
+ else {
+ if (visualCategory == GeoDataFeature::Bathymetry) {
+ const int elevation = extractBathymetryElevation(feature);
+ setZValue(zValue() + elevation);
+ }
+
+ const QString paintLayer = QLatin1String("Polygon/%1") + StyleBuilder::visualCategoryName(visualCategory);
setPaintLayers(QStringList() << paintLayer);
}
}