summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Egorov <[email protected]>2015-03-09 21:39:23 +0100
committerDennis Nienhüser <[email protected]>2015-03-09 21:40:58 +0100
commit6f44f207cd0d2da039bec99141b4c804ea208022 (patch)
tree4492a3a6b95ba68382606c40e173ba6d369f528f
parent287e7db6a02470bd699afb965f6d80c4a6057cbd (diff)
Fix construction of unknown planet
If we pass unknown planet name to PlanetFactory, it must show warning and set planet name to 'Unknown'. See commit 61e92c8ff13a26565 for proper behavior. Issue detected by Cppcheck: "Expression is always false because 'else if' condition matches previous condition at line 80." REVIEW: 122853
-rw-r--r--src/lib/marble/PlanetFactory.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/marble/PlanetFactory.cpp b/src/lib/marble/PlanetFactory.cpp
index 9c4b1d2..72ec634 100644
--- a/src/lib/marble/PlanetFactory.cpp
+++ b/src/lib/marble/PlanetFactory.cpp
@@ -214,7 +214,7 @@ Planet PlanetFactory::construct( const QString &id )
planet.setRadius( 10000000.0 );
planet.setName( "Sky" );
planet.setHasAtmosphere( false );
- } else if ( id == "earth" ) {
+ } else {
mDebug() << "WARNING: Creating Planet instance" << id << "with invalid orbital elements";
planet.setRadius( 10000000.0 );
planet.setName( "Unknown" );