[Marble-commits] KDE/kdeedu/marble/src/plugins/render/osmannotate
Andrew Manson
g.real.ate at gmail.com
Mon Jul 27 18:26:06 CEST 2009
SVN commit 1003081 by mansona:
Committing an example case of BUG:201681
The offending line is commented out, remove comments from
OsmAnnotatePlugin.cpp line 212 to recreate the bug.
M +4 -10 OsmAnnotatePlugin.cpp
M +1 -0 osm/OsmBoundsGraphicsItem.cpp
M +8 -1 osm/OsmBoundsGraphicsItem.h
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/OsmAnnotatePlugin.cpp #1003080:1003081
@@ -10,11 +10,6 @@
#include "OsmAnnotatePlugin.h"
-#include <QtGui/QColor>
-#include <QtGui/QPixmap>
-#include <QtGui/QRadialGradient>
-#include <QtGui/QPushButton>
-#include <QtGui/QPainterPath>
#include <QtGui/QFileDialog>
//#include <Phonon/MediaObject>
@@ -22,13 +17,10 @@
#include <QtCore/QDebug>
#include <QtGui/QAction>
-#include "ViewportParams.h"
#include "AbstractProjection.h"
#include "AreaAnnotation.h"
#include "MarbleDirs.h"
#include "GeoPainter.h"
-#include "GeoDataDocument.h"
-#include "GeoDataCoordinates.h"
#include "GeoDataParser.h"
#include "MarbleWidget.h"
#include "osm/OsmBoundsGraphicsItem.h"
@@ -212,10 +204,12 @@
if( m_itemModel->size() > 0 ) {
OsmBoundsGraphicsItem* item;
// mostly guarenteed that the first item will be a bounds item
+ // if not then don't centre on anything
item = dynamic_cast<OsmBoundsGraphicsItem*>( m_itemModel->first() );
if( item ) {
- //get the place to zoom to
- qDebug() << item->coordinate().toString();
+ // FIXME: uncomment this line if you would like to recreate the
+ // crash in BUG:201681
+// m_marbleWidget->centerOn( item->coordinate(), false );
//get the zoom level
// difficult?
}
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmBoundsGraphicsItem.cpp #1003080:1003081
@@ -28,6 +28,7 @@
void OsmBoundsGraphicsItem::append( const GeoDataCoordinates& value )
{
m_lineString.append( value );
+ setCoordinate( m_lineString.latLonAltBox().center() );
}
void OsmBoundsGraphicsItem::paint( GeoPainter* painter, ViewportParams * viewport,
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmBoundsGraphicsItem.h #1003080:1003081
@@ -34,7 +34,14 @@
virtual void paint( GeoPainter* painter, ViewportParams *viewport,
const QString &renderPos, GeoSceneLayer *layer );
private:
- GeoDataLineString m_lineString;
+ /**
+ * This class is using a GeoDataLineString as its data representation so
+ * that it can be closer to the visual representation. It does not make
+ * sense to use a LatLon box as it does not explicitly have a geographical
+ * representation.
+ */
+ GeoDataLineString m_lineString;
+
QPen m_pen;
};
More information about the Marble-commits
mailing list