[Marble-commits] KDE/kdeedu/marble/src
Thibaut Gridel
tgridel at free.fr
Sat Jul 17 11:00:02 CEST 2010
SVN commit 1150960 by tgridel:
GeoDataFeature: get rid of featureId for type determination
M +1 -4 lib/FileLoader.cpp
M +4 -2 lib/PlacemarkManager.cpp
M +6 -4 lib/geodata/data/GeoDataContainer.cpp
M +1 -2 lib/geodata/handlers/kml/KmlAltitudeModeTagHandler.cpp
M +1 -1 plugins/render/geodata/GeoRendererView.cpp
--- trunk/KDE/kdeedu/marble/src/lib/FileLoader.cpp #1150959:1150960
@@ -311,12 +311,9 @@
QVector<GeoDataFolder*>::const_iterator cont = folders.constBegin();
QVector<GeoDataFolder*>::const_iterator endcont = folders.constEnd();
for (; cont != endcont; ++cont ) {
- if (GeoDataFolderId == (*cont)->featureId() ) {
- GeoDataContainer *subcontainer = *cont;
- savePlacemarks(out, subcontainer);
+ savePlacemarks(out, *cont);
}
}
-}
#include "FileLoader.moc"
} // namespace Marble
--- trunk/KDE/kdeedu/marble/src/lib/PlacemarkManager.cpp #1150959:1150960
@@ -26,6 +26,7 @@
#include "MarbleDataFacade.h"
#include "GeoDataDocument.h"
+#include "GeoDataFolder.h"
#include "GeoDataParser.h"
#include "GeoDataPlacemark.h"
@@ -137,8 +138,9 @@
results += container->placemarkList();
for (; it != end; ++it) {
- if ( GeoDataFolderId == (*it)->featureId() ) {
- results += recurseContainer(static_cast<GeoDataContainer*>(*it));
+ GeoDataFolder *folder = dynamic_cast<GeoDataFolder*>(*it);
+ if ( folder ) {
+ results += recurseContainer( folder );
}
}
return results;
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataContainer.cpp #1150959:1150960
@@ -63,8 +63,9 @@
QVector<GeoDataFeature*>::const_iterator end = p()->m_vector.constEnd();
for (; it != end; ++it) {
- if ( (*it)->featureId() == GeoDataFolderId ) {
- results.append( static_cast<GeoDataFolder*>( *it ) );
+ GeoDataFolder *folder = dynamic_cast<GeoDataFolder*>(*it);
+ if ( folder ) {
+ results.append( folder );
}
}
@@ -79,8 +80,9 @@
QVector<GeoDataFeature*>::const_iterator end = p()->m_vector.constEnd();
for (; it != end; ++it) {
- if ( GeoDataPlacemarkId == (*it)->featureId() ) {
- results.append( static_cast<GeoDataPlacemark*>( *it ) );
+ GeoDataPlacemark *placemark = dynamic_cast<GeoDataPlacemark*>( *it );
+ if ( placemark ) {
+ results.append( placemark );
}
}
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlAltitudeModeTagHandler.cpp #1150959:1150960
@@ -57,8 +57,7 @@
GeoStackItem parentItem = parser.parentElement();
- if ( parentItem.is<GeoDataFeature>()
- && parentItem.nodeAs<GeoDataFeature>()->featureId() == GeoDataPlacemarkId
+ if ( parentItem.is<GeoDataPlacemark>()
&& parentItem.represents( kmlTag_Point ) )
{
parentItem.nodeAs<GeoDataPlacemark>()->geometry()->setAltitudeMode( mode );
--- trunk/KDE/kdeedu/marble/src/plugins/render/geodata/GeoRendererView.cpp #1150959:1150960
@@ -134,7 +134,7 @@
}
}
else if( dynamic_cast<GeoDataFeature*>( object ) ) {
- if( dynamic_cast<GeoDataFeature*>( object )->featureId() == GeoDataPlacemarkId ) {
+ if( dynamic_cast<GeoDataPlacemark*>( object ) ) {
GeoDataPlacemark *placemark = static_cast<GeoDataPlacemark*>( object );
m_styleUrl = placemark->styleUrl();
}
More information about the Marble-commits
mailing list