[Marble-commits] KDE/kdeedu/marble/src/lib/geodata
Thibaut Gridel
tgridel at free.fr
Fri Aug 13 19:33:29 CEST 2010
SVN commit 1163316 by tgridel:
geodata: various parsing and styling fixes
M +7 -3 data/GeoDataIconStyle.cpp
M +1 -1 handlers/kml/KmlAltitudeTagHandler.cpp
M +0 -1 handlers/kml/KmlCoordinatesTagHandler.cpp
M +2 -3 handlers/kml/KmlLatitudeTagHandler.cpp
M +2 -3 handlers/kml/KmlLongitudeTagHandler.cpp
M +2 -1 handlers/kml/KmlLookAtTagHandler.cpp
M +1 -1 handlers/kml/KmlRangeTagHandler.cpp
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataIconStyle.cpp #1163315:1163316
@@ -10,6 +10,7 @@
#include "GeoDataIconStyle.h"
+#include "MarbleDirs.h"
#include "MarbleDebug.h"
#include "GeoDataTypes.h"
@@ -21,7 +22,8 @@
{
public:
GeoDataIconStylePrivate()
- : m_scale( 1.0 )
+ : m_scale( 1.0 ),
+ m_iconPath( MarbleDirs::path( "bitmaps/default_location.png" ) )
{
}
@@ -91,8 +93,10 @@
{
if(!d->m_icon.isNull())
return d->m_icon;
- else if(!d->m_iconPath.isEmpty())
- return QPixmap(d->m_iconPath);
+ else if(!d->m_iconPath.isEmpty()) {
+ d->m_icon = QPixmap(d->m_iconPath);
+ return d->m_icon;
+ }
else
return QPixmap();
}
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlAltitudeTagHandler.cpp #1163315:1163316
@@ -31,7 +31,7 @@
GeoStackItem parentItem = parser.parentElement();
- if ( parentItem.nodeAs<GeoDataLookAt>() ){
+ if ( parentItem.is<GeoDataLookAt>() ){
QString altitudeTemp = parser.readElementText().trimmed ();
qreal altitude = altitudeTemp.toDouble();
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlCoordinatesTagHandler.cpp #1163315:1163316
@@ -64,7 +64,6 @@
coordinates.at( 2 ).toDouble() );
}
parentItem.nodeAs<GeoDataPlacemark>()->setCoordinate( *coord );
- parentItem.nodeAs<GeoDataPlacemark>()->setGeometry( coord );
} else {
GeoDataCoordinates coord;
if ( coordinates.size() == 2 ) {
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlLatitudeTagHandler.cpp #1163315:1163316
@@ -31,13 +31,12 @@
GeoStackItem parentItem = parser.parentElement();
- if ( parentItem.nodeAs<GeoDataLookAt>() ){
+ if ( parentItem.is<GeoDataLookAt>() ){
QString latitudeTemp = parser.readElementText().trimmed ();
qreal latitude = latitudeTemp.toDouble();
parentItem.nodeAs<GeoDataLookAt>()->setLatitude(latitude,
- GeoDataCoordinates::
- Degree);
+ GeoDataCoordinates::Degree);
#ifdef DEBUG_TAGS
mDebug () << "Parsed <" << kmlTag_latitude << "> containing: " <<
latitude << " parent item name: " << parentItem.qualifiedName ().
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlLongitudeTagHandler.cpp #1163315:1163316
@@ -29,12 +29,11 @@
Q_ASSERT( parser.isStartElement() && parser.isValidElement( kmlTag_longitude ) );
GeoStackItem parentItem = parser.parentElement();
- if ( parentItem.nodeAs<GeoDataLookAt>() ){
+ if ( parentItem.is<GeoDataLookAt>() ){
QString longitudeTemp = parser.readElementText().trimmed();
qreal longitude = longitudeTemp.toDouble();
parentItem.nodeAs<GeoDataLookAt>()->setLongitude(longitude,
- GeoDataCoordinates::
- Degree);
+ GeoDataCoordinates::Degree);
#ifdef DEBUG_TAGS
mDebug () << "Parsed <" << kmlTag_longitude << "> containing: " <<
longitude << " parent item name: " << parentItem.qualifiedName ().
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlLookAtTagHandler.cpp #1163315:1163316
@@ -38,9 +38,10 @@
GeoDataPlacemark *placemark = parentItem.nodeAs<GeoDataPlacemark>();
placemark->setLookAt( lookAt );
- return static_cast <GeoDataLookAt*>( ( placemark->lookAt() ) );
+ return lookAt;
}
else {
+ delete lookAt;
return 0;
}
}
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlRangeTagHandler.cpp #1163315:1163316
@@ -22,7 +22,7 @@
GeoStackItem parentItem = parser.parentElement ();
- if ( parentItem.nodeAs<GeoDataLookAt>() ){
+ if ( parentItem.is<GeoDataLookAt>() ){
QString rangeTemp = parser.readElementText().trimmed();
qreal range = rangeTemp.toDouble();
More information about the Marble-commits
mailing list