[Marble-commits] KDE/kdeedu/marble/src/lib
Andrew Manson
g.real.ate at gmail.com
Thu Jul 16 14:14:58 CEST 2009
SVN commit 997733 by mansona:
BUG:199788 fixed
reenabling the functionality of the File View when a GPX file is loaded
also fixing a painter setting overflow
M +5 -5 MarbleWidget.cpp
M +7 -0 gps/GpsLayer.cpp
M +1 -0 gps/GpsLayer.h
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.cpp #997732:997733
@@ -48,6 +48,7 @@
#include "MarbleWidgetInputHandler.h"
#include "TileCreatorDialog.h"
#include "gps/GpsLayer.h"
+#include "gps/GpxFile.h"
#include "RenderPlugin.h"
#include "SunLocator.h"
#include "MergedLayerDecorator.h"
@@ -1031,12 +1032,11 @@
void MarbleWidget::openGpxFile(QString &filename)
{
-#ifndef KML_GSOC
- d->m_model->gpsLayer()->loadGpx( filename );
-#else
- GpxFileViewItem* item = new GpxFileViewItem( new GpxFile( filename ) );
+ GpxFile* gpxFile = new GpxFile( filename );
+ GpxFileViewItem* item = new GpxFileViewItem( gpxFile );
+
d->m_model->fileViewModel()->append( item );
-#endif
+ d->m_model->gpsLayer()->addGpxFile( gpxFile );
}
GpxFileModel *MarbleWidget::gpxFileModel()
--- trunk/KDE/kdeedu/marble/src/lib/gps/GpsLayer.cpp #997732:997733
@@ -63,6 +63,7 @@
void GpsLayer::paintLayer( ClipPainter *painter,
const QSize &canvasSize, ViewParams *viewParams )
{
+ painter->save();
if ( visible() ) {
m_currentPosition->draw( painter, canvasSize,
viewParams );
@@ -80,6 +81,7 @@
(*it)->draw( painter, canvasSize, viewParams );
}
}
+ painter->restore();
}
void GpsLayer::paintCurrentPosition( ClipPainter *painter,
@@ -103,3 +105,8 @@
m_fileModel->addFile( tempFile );
}
+
+void GpsLayer::addGpxFile( GpxFile* file )
+{
+ m_fileModel->addFile( file );
+}
--- trunk/KDE/kdeedu/marble/src/lib/gps/GpsLayer.h #997732:997733
@@ -40,6 +40,7 @@
void changeCurrentPosition( qreal lat, qreal lon );
void loadGpx(const QString &fileName);
+ void addGpxFile( GpxFile* file );
// public slots:
bool updateGps(const QSize &canvasSize, ViewParams *viewParams,
QRegion ®);
More information about the Marble-commits
mailing list