[Marble-commits] KDE/kdeedu/marble/src/plugins/render
Andrew Manson
g.real.ate at gmail.com
Mon Jul 20 18:35:16 CEST 2009
SVN commit 999946 by mansona:
committing test case to catch the stack item bug in action.
Loading OSM files will crash marble with this commit
M +1 -1 CMakeLists.txt
M +20 -1 osmannotate/osm/OsmNdTagHandler.cpp
M +4 -2 osmannotate/osm/OsmWayTagHandler.cpp
--- trunk/KDE/kdeedu/marble/src/plugins/render/CMakeLists.txt #999945:999946
@@ -13,7 +13,7 @@
# add_subdirectory ( twitter )
add_subdirectory( wikipedia )
add_subdirectory( weather )
-# add_subdirectory( osmannotate )
+add_subdirectory( osmannotate )
add_subdirectory( navigation )
# add_subdirectory ( FITemplate )
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmNdTagHandler.cpp #999945:999946
@@ -13,6 +13,8 @@
#include "OsmNdTagHandler.h"
#include "OsmWayGraphicsItem.h"
+#include <QtCore/QDebug>
+
namespace Marble
{
namespace osm
@@ -28,10 +30,27 @@
GeoStackItem parent = parser.parentElement();
+ //FIXME: problem with the stack implementation
+
+ //this should be "way"
+ qDebug() << Q_FUNC_INFO;
+ qDebug() << "parent element name:" << parent.first.first;
+ Q_ASSERT( parent.first.first.compare("way") == 0 );
+
+ //this should be set because we know that the containing
+ // <way> element did not return 0
+ qDebug() << " parent associated node pointer:" << parent.associatedNode();
+
+ Q_ASSERT( parent.associatedNode() );
+
GeoNode* wayNode = parent.associatedNode();
- OsmWayGraphicsItem* way = (OsmWayGraphicsItem*)wayNode;
+ QString n = parser.name().toString();
+ OsmWayGraphicsItem* way = reinterpret_cast<OsmWayGraphicsItem*>(wayNode);
+
+ Q_ASSERT( way );
+
//the line that crashes
// way->addNodeReferenceId( parser.attribute("ref").toInt() );
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmWayTagHandler.cpp #999945:999946
@@ -26,9 +26,11 @@
GeoNode* OsmWayTagHandler::parse( GeoParser& parser ) const
{
+ GeoNode* result;
OsmWayGraphicsItem* way = new OsmWayGraphicsItem();
- qDebug() << ((GeoNode*)(way));
- return ((GeoNode*)(way));
+ result = reinterpret_cast<GeoNode*>(way);
+ Q_ASSERT( result );
+ return result;
}
}
More information about the Marble-commits
mailing list