[Marble-commits] KDE/kdeedu/marble/src/lib/geodata
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Tue Jun 22 11:55:50 CEST 2010
SVN commit 1141208 by beschow:
revert r1140314, keeping GeoSceneTexture as simple as it is
M +9 -1 handlers/dgml/DgmlProjectionTagHandler.cpp
M +2 -9 scene/GeoSceneTexture.cpp
M +1 -1 scene/GeoSceneTexture.h
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlProjectionTagHandler.cpp #1141207:1141208
@@ -46,9 +46,17 @@
// Attribute name, default to "Equirectangular"
const QString nameStr = parser.attribute( dgmlAttr_name ).trimmed();
- if ( !parentItem.nodeAs<GeoSceneTexture>()->setProjection( nameStr ) )
+ if ( !nameStr.isEmpty() ) {
+ GeoSceneTexture::Projection projection = GeoSceneTexture::Equirectangular;
+ if ( nameStr == "Equirectangular" )
+ projection = GeoSceneTexture::Equirectangular;
+ else if ( nameStr == "Mercator" )
+ projection = GeoSceneTexture::Mercator;
+ else
parser.raiseWarning( QString( "Value not allowed for attribute name: %1" ).arg( nameStr ));
+ parentItem.nodeAs<GeoSceneTexture>()->setProjection( projection );
+ }
return 0;
}
--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneTexture.cpp #1141207:1141208
@@ -118,16 +118,9 @@
return m_projection;
}
-bool GeoSceneTexture::setProjection( const QString &name )
+void GeoSceneTexture::setProjection( const Projection projection )
{
- if ( name == "Equirectangular" )
- m_projection = GeoSceneTexture::Equirectangular;
- else if ( name == "Mercator" )
- m_projection = GeoSceneTexture::Mercator;
- else
- return false;
-
- return true;
+ m_projection = projection;
}
QUrl GeoSceneTexture::downloadUrl( const TileId &id )
--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneTexture.h #1141207:1141208
@@ -73,7 +73,7 @@
void setMaximumTileLevel( const int );
Projection projection() const;
- bool setProjection( const QString &name );
+ void setProjection( const Projection );
Blending const * blending() const;
void setBlending( Blending const * const );
More information about the Marble-commits
mailing list