[Marble-commits] branches/KDE/4.3/kdeedu/marble/src/lib
Andrew Manson
g.real.ate at gmail.com
Thu Jul 16 14:17:38 CEST 2009
SVN commit 997734 by mansona:
BUG:199788 fixed
backport of trunk r997733
re-enabling the functionality of the file view when a GpxFile is loaded
also fixing a painter settings overflow
M +5 -5 MarbleWidget.cpp
M +7 -0 gps/GpsLayer.cpp
M +1 -0 gps/GpsLayer.h
--- branches/KDE/4.3/kdeedu/marble/src/lib/MarbleWidget.cpp #997733:997734
@@ -42,6 +42,7 @@
#include "MarblePlacemarkModel.h"
#include "MarbleWidgetInputHandler.h"
#include "TileCreatorDialog.h"
+#include "gps/GpxFile.h"
#include "gps/GpsLayer.h"
#include "SunLocator.h"
#include "MergedLayerDecorator.h"
@@ -1012,12 +1013,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()
--- branches/KDE/4.3/kdeedu/marble/src/lib/gps/GpsLayer.cpp #997733:997734
@@ -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 );
+}
--- branches/KDE/4.3/kdeedu/marble/src/lib/gps/GpsLayer.h #997733:997734
@@ -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