[Marble-commits] KDE/kdeedu/marble/src/lib/geodata/data
Thibaut Gridel
tgridel at free.fr
Thu Jan 27 22:24:37 CET 2011
SVN commit 1217554 by tgridel:
GeoDataPoint: use p() to get correct typeinfo, and properly initialise parents
M +2 -2 GeoDataGeometry.cpp
M +1 -1 GeoDataPlacemark.cpp
M +7 -1 GeoDataPoint.cpp
M +5 -0 GeoDataPoint.h
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataGeometry.cpp #1217553:1217554
@@ -72,12 +72,12 @@
const char* GeoDataGeometry::nodeType() const
{
- return d->nodeType();
+ return p()->nodeType();
}
EnumGeometryId GeoDataGeometry::geometryId() const
{
- return d->geometryId();
+ return p()->geometryId();
}
GeoDataGeometry& GeoDataGeometry::operator=( const GeoDataGeometry& other )
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataPlacemark.cpp #1217553:1217554
@@ -77,7 +77,7 @@
GeoDataCoordinates GeoDataPlacemark::coordinate() const
{
if( p()->m_geometry ) {
- if ( p()->m_geometry->geometryId() != GeoDataPointId ) {
+ if ( p()->m_geometry->nodeType() != GeoDataTypes::GeoDataPointType ) {
return p()->m_geometry->latLonAltBox().center();
} else {
return GeoDataCoordinates( *static_cast<GeoDataPoint*>( p()->m_geometry ) );
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataPoint.cpp #1217553:1217554
@@ -44,7 +44,8 @@
}
GeoDataPoint::GeoDataPoint( const GeoDataCoordinates& other )
- : GeoDataCoordinates( other )
+ : GeoDataCoordinates( other ),
+ GeoDataGeometry ( new GeoDataPointPrivate )
{
}
@@ -63,6 +64,11 @@
{
}
+GeoDataPointPrivate* GeoDataPoint::p() const
+{
+ return static_cast<GeoDataPointPrivate*>(GeoDataGeometry::d);
+}
+
const char* GeoDataPoint::nodeType() const
{
return GeoDataTypes::GeoDataPointType;
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataPoint.h #1217553:1217554
@@ -22,6 +22,7 @@
#include "geodata_export.h"
#include "GeoDataGeometry.h"
#include "GeoDataCoordinates.h"
+#include "GeoDataPoint_p.h"
namespace Marble
{
@@ -81,6 +82,10 @@
virtual void unpack( QDataStream& stream );
virtual void detach();
+
+ private:
+ GeoDataPointPrivate* p() const;
+
};
}
More information about the Marble-commits
mailing list