[Marble-commits] KDE/kdeedu/marble/src/lib
Thibaut Gridel
tgridel at free.fr
Mon Aug 17 19:58:08 CEST 2009
SVN commit 1012482 by tgridel:
GpxFile: moving file open in MarbleModel and remove dead code
M +1 -7 MarbleMap.cpp
M +11 -0 MarbleModel.cpp
M +1 -0 MarbleModel.h
M +1 -7 MarbleWidget.cpp
M +0 -15 gps/GpsLayer.cpp
M +0 -2 gps/GpsLayer.h
M +0 -1 gps/PositionTracking.h
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.cpp #1012481:1012482
@@ -43,7 +43,6 @@
#include "GeoSceneDocument.h"
#include "GeoSceneHead.h"
#include "GeoSceneZoom.h"
-#include "GpxFileViewItem.h"
#include "HttpDownloadManager.h"
#include "MarbleDirs.h"
#include "MarbleLocale.h"
@@ -1148,12 +1147,7 @@
void MarbleMap::openGpxFile(QString &filename)
{
-#ifndef KML_GSOC
- d->m_model->gpsLayer()->loadGpx( filename );
-#else
- GpxFileViewItem* item = new GpxFileViewItem( new GpxFile( filename ) );
- d->m_model->fileViewModel()->append( item );
-#endif
+ d->m_model->openGpxFile( filename );
}
GpxFileModel *MarbleMap::gpxFileModel()
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.cpp #1012481:1012482
@@ -48,6 +48,8 @@
#include "EquirectScanlineTextureMapper.h"
#include "MercatorScanlineTextureMapper.h"
#include "gps/GpxFileModel.h"
+#include "gps/GpxFile.h"
+#include "GpxFileViewItem.h"
#include "HttpDownloadManager.h"
#include "KmlFileViewItem.h"
#include "LayerManager.h"
@@ -693,6 +695,15 @@
return d->m_dataFacade->fileViewModel();
}
+void MarbleModel::openGpxFile( const QString& filename )
+{
+ GpxFile* gpxFile = new GpxFile( filename );
+ GpxFileViewItem* item = new GpxFileViewItem( gpxFile );
+
+ d->m_dataFacade->fileViewModel()->append( item );
+ d->m_gpxFileModel->addFile( gpxFile );
+}
+
void MarbleModel::addPlacemarkFile( const QString& filename )
{
d->m_placemarkmanager->loadKml( filename, false );
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.h #1012481:1012482
@@ -200,6 +200,7 @@
*/
void setDownloadManager( HttpDownloadManager *downloadManager );
+ void openGpxFile( const QString& filename );
void addPlacemarkFile( const QString& filename );
void addPlacemarkData( const QString& data, const QString& key = "data" );
void removePlacemarkKey( const QString& key );
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.cpp #1012481:1012482
@@ -41,13 +41,11 @@
#include "GeoPainter.h"
#include "FileViewModel.h"
#include "GeoDataCoordinates.h"
-#include "GpxFileViewItem.h"
#include "MarblePhysics.h"
#include "MarblePlacemarkModel.h"
#include "MarbleWidgetInputHandler.h"
#include "TileCreatorDialog.h"
#include "gps/GpsLayer.h"
-#include "gps/GpxFile.h"
#include "RenderPlugin.h"
#include "SunLocator.h"
#include "MergedLayerDecorator.h"
@@ -1083,11 +1081,7 @@
void MarbleWidget::openGpxFile(QString &filename)
{
- GpxFile* gpxFile = new GpxFile( filename );
- GpxFileViewItem* item = new GpxFileViewItem( gpxFile );
-
- d->m_model->fileViewModel()->append( item );
- d->m_model->gpsLayer()->addGpxFile( gpxFile );
+ d->m_map->openGpxFile(filename);
}
GpxFileModel *MarbleWidget::gpxFileModel()
--- trunk/KDE/kdeedu/marble/src/lib/gps/GpsLayer.cpp #1012481:1012482
@@ -97,21 +97,6 @@
m_currentPosition->setPosition( lat, lon );
}
-void GpsLayer::loadGpx( const QString &fileName )
-{
- GpxFile *tempFile = new GpxFile( fileName );
-
-// QTextStream test(stderr);
-// test << *tempFile;
-
- m_fileModel->addFile( tempFile );
-}
-
-void GpsLayer::addGpxFile( GpxFile* file )
-{
- m_fileModel->addFile( file );
-}
-
void GpsLayer::clearModel()
{
// Here is a know memory leak, because m_fileModel does not get
--- trunk/KDE/kdeedu/marble/src/lib/gps/GpsLayer.h #1012481:1012482
@@ -40,8 +40,6 @@
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 ®);
--- trunk/KDE/kdeedu/marble/src/lib/gps/PositionTracking.h #1012481:1012482
@@ -94,7 +94,6 @@
qreal m_speed;
//used to draw the arrow in gps tracking
- GpxFile *m_currentGpx;
QPointF m_relativeTip;
QPointF m_relativeLeft;
QPointF m_relativeRight;
More information about the Marble-commits
mailing list