[Marble-commits] KDE/kdeedu/marble/src/lib
Thibaut Gridel
tgridel at free.fr
Sat Jan 15 14:34:02 CET 2011
SVN commit 1214584 by tgridel:
GeoDataTreeModel: limit geometries if they are not multigeometries
M +10 -5 GeoDataTreeModel.cpp
--- trunk/KDE/kdeedu/marble/src/lib/GeoDataTreeModel.cpp #1214583:1214584
@@ -68,17 +68,17 @@
return false;
}
+ if ( parentItem->nodeType() == GeoDataTypes::GeoDataPlacemarkType ) {
+ GeoDataPlacemark *placemark = static_cast<GeoDataPlacemark*>( parentItem );
+ return dynamic_cast<GeoDataMultiGeometry*>( placemark->geometry() );
+ }
+
if ( parentItem->nodeType() == GeoDataTypes::GeoDataFolderType
|| parentItem->nodeType() == GeoDataTypes::GeoDataDocumentType ) {
GeoDataContainer *container = static_cast<GeoDataContainer*>( parentItem );
return container->size();
}
- if ( parentItem->nodeType() == GeoDataTypes::GeoDataPlacemarkType ) {
- GeoDataPlacemark *placemark = static_cast<GeoDataPlacemark*>( parentItem );
- return placemark->geometry();
- }
-
if ( parentItem->nodeType() == GeoDataTypes::GeoDataMultiGeometryType ) {
GeoDataMultiGeometry *geometry = static_cast<GeoDataMultiGeometry*>( parentItem );
return geometry->size();
@@ -118,9 +118,12 @@
}
if ( parentItem->nodeType() == GeoDataTypes::GeoDataPlacemarkType ) {
+ GeoDataPlacemark *placemark = static_cast<GeoDataPlacemark*>( parentItem );
+ if ( dynamic_cast<GeoDataMultiGeometry*>( placemark->geometry() ) ) {
// mDebug() << "rowCount " << type << "(" << parentItem << ") = 1";
return 1;
}
+ }
if ( parentItem->nodeType() == GeoDataTypes::GeoDataMultiGeometryType ) {
GeoDataMultiGeometry *geometry = static_cast<GeoDataMultiGeometry*>( parentItem );
@@ -280,8 +283,10 @@
if ( parentItem->nodeType() == GeoDataTypes::GeoDataPlacemarkType ) {
GeoDataPlacemark *placemark = static_cast<GeoDataPlacemark*>( parentItem );
childItem = placemark->geometry();
+ if ( dynamic_cast<GeoDataMultiGeometry*>( childItem ) ) {
return createIndex( row, column, childItem );
}
+ }
if ( parentItem->nodeType() == GeoDataTypes::GeoDataMultiGeometryType ) {
GeoDataMultiGeometry *geometry = static_cast<GeoDataMultiGeometry*>( parentItem );
More information about the Marble-commits
mailing list