summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-11 12:09:19 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-11 12:09:19 (GMT)
commitc2664c90bd331b76a64174951cb8255a52f4e3b0 (patch)
tree7fb234f808791fc4ecd730cb3c0332fc2bae40b8
parent8a7167afce107843e44bfa7d767e26d0241d494b (diff)
Use "else" with alternatives on fine-tuning zoomlevel in FileLoader
-rw-r--r--src/lib/marble/FileLoader.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/lib/marble/FileLoader.cpp b/src/lib/marble/FileLoader.cpp
index 5b4c309..2cb8bd3 100644
--- a/src/lib/marble/FileLoader.cpp
+++ b/src/lib/marble/FileLoader.cpp
@@ -490,20 +490,26 @@ void FileLoaderPrivate::createFilterProperties( GeoDataContainer *container )
placemark->setVisualCategory( GeoDataPlacemark::UnmannedHardLandingSite );
}
- if (placemarkRole == QLatin1String("W") && placemark->zoomLevel() < 4)
- placemark->setZoomLevel( 4 );
- if (placemarkRole == QLatin1String("O"))
- placemark->setZoomLevel( 2 );
- if (placemarkRole == QLatin1String("K"))
- placemark->setZoomLevel( 0 );
- if ( !placemark->isVisible() ) {
+ // At last fine-tune zoomlevel:
+ if (!placemark->isVisible()) {
placemark->setZoomLevel( 18 );
}
// Workaround: Emulate missing "setVisible" serialization by allowing for population
// values smaller than -1 which are considered invisible.
- if ( placemark->population() < -1 ) {
+ else if (placemark->population() < -1) {
placemark->setZoomLevel( 18 );
}
+ else if (placemarkRole == QLatin1String("W")) {
+ if (placemark->zoomLevel() < 4) {
+ placemark->setZoomLevel( 4 );
+ }
+ }
+ else if (placemarkRole == QLatin1String("O")) {
+ placemark->setZoomLevel( 2 );
+ }
+ else if (placemarkRole == QLatin1String("K")) {
+ placemark->setZoomLevel( 0 );
+ }
} else {
qWarning() << Q_FUNC_INFO << "Unknown feature" << (*i)->nodeType() << ". Skipping.";
}