[Marble-commits] branches/KDE/4.5/kdeedu/marble/src/lib
Bastian Holst
bastianholst at gmx.de
Fri Jul 9 14:35:49 CEST 2010
SVN commit 1147947 by bholst:
Disabled the painting of points if the placemark does not represent a point.
backport r1147946
M +2 -0 MarblePlacemarkModel.cpp
M +2 -1 MarblePlacemarkModel.h
M +12 -0 PlacemarkLayout.cpp
M +2 -0 geodata/data/GeoDataGeometry.h
--- branches/KDE/4.5/kdeedu/marble/src/lib/MarblePlacemarkModel.cpp #1147946:1147947
@@ -110,6 +110,8 @@
return qVariantFromValue( d->m_placemarkContainer->at( index.row() ).coordinate() );
} else if ( role == StyleRole ) {
return qVariantFromValue( d->m_placemarkContainer->at( index.row() ).style() );
+ } else if ( role == GeometryRole ) {
+ return qVariantFromValue( *d->m_placemarkContainer->at( index.row() ).geometry() );
/* } else if ( role == ObjectPointerRole ) {
return qVariantFromValue( dynamic_cast<GeoDataObject*>( d->m_placemarkContainer->at( index.row() ) ) );*/
} else
--- branches/KDE/4.5/kdeedu/marble/src/lib/MarblePlacemarkModel.h #1147946:1147947
@@ -56,7 +56,8 @@
StyleRole, ///< The style
PopularityIndexRole, ///< The popularity index
PopularityRole, ///< The popularity
- ObjectPointerRole ///< The pointer to a specific object
+ ObjectPointerRole, ///< The pointer to a specific object
+ GeometryRole ///< The GeoDataGeometry geometry
};
/**
--- branches/KDE/4.5/kdeedu/marble/src/lib/PlacemarkLayout.cpp #1147946:1147947
@@ -251,6 +251,12 @@
for ( int i = 0; i < selectedIndexes.count(); ++i ) {
const QModelIndex index = selectedIndexes.at( i );
+ GeoDataGeometry geometry
+ = qvariant_cast<GeoDataGeometry>( index.data( MarblePlacemarkModel::GeometryRole ) );
+ if( geometry.geometryId() != GeoDataPointId ) {
+ continue;
+ }
+
GeoDataCoordinates geopoint = qvariant_cast<GeoDataCoordinates>( index.data( MarblePlacemarkModel::CoordinateRole ) );
if ( !latLonAltBox.contains( geopoint ) ||
@@ -346,6 +352,12 @@
continue;
}
+ GeoDataGeometry geometry
+ = qvariant_cast<GeoDataGeometry>( index.data( MarblePlacemarkModel::GeometryRole ) );
+ if( geometry.geometryId() != GeoDataPointId ) {
+ continue;
+ }
+
int popularityIndex = index.data( MarblePlacemarkModel::PopularityIndexRole ).toInt();
if ( popularityIndex < 1 ) {
--- branches/KDE/4.5/kdeedu/marble/src/lib/geodata/data/GeoDataGeometry.h #1147946:1147947
@@ -87,4 +87,6 @@
}
+Q_DECLARE_METATYPE( Marble::GeoDataGeometry )
+
#endif
More information about the Marble-commits
mailing list