[Marble-commits] KDE/kdeedu/marble/src
Thibaut Gridel
tgridel at free.fr
Sun Jun 6 21:25:57 CEST 2010
SVN commit 1135202 by tgridel:
marblemodel need not expose gpslayer
M +0 -1 MarbleTest.cpp
M +3 -4 lib/MarbleControlBox.cpp
M +1 -2 lib/MarbleMap.cpp
M +0 -25 lib/MarbleModel.cpp
M +0 -28 lib/MarbleModel.h
M +0 -1 lib/MarbleWidget.cpp
M +2 -1 lib/gps/GpsLayer.cpp
--- trunk/KDE/kdeedu/marble/src/MarbleTest.cpp #1135201:1135202
@@ -86,7 +86,6 @@
//
qDebug("stopping polling now");
- m_marbleWidget->model()->stopPolling();
m_marbleWidget->centerOn( -15.2325, 58.3723 );
m_marbleWidget->setShowGps( true );
--- trunk/KDE/kdeedu/marble/src/lib/MarbleControlBox.cpp #1135201:1135202
@@ -35,7 +35,6 @@
#include "MarbleModel.h"
#include "FileViewModel.h"
#include "gps/GpxFileModel.h"
-#include "gps/GpsLayer.h"
#include "gps/PositionTracking.h"
#include "MarbleLocale.h"
#include "MarblePlacemarkModel.h"
@@ -540,7 +539,7 @@
}
if ( !enabled ) {
- d->m_widget->map()->model()->gpsLayer()->setVisible( false );
+ d->m_widget->map()->setShowGps( false );
}
}
}
@@ -740,7 +739,7 @@
{
if ( provider == tr("Disabled") ) {
d->uiWidget.locationLabel->setEnabled( false );
- d->m_widget->map()->model()->gpsLayer()->setVisible( false );
+ d->m_widget->map()->setShowGps( false );
d->m_widget->model()->positionTracking()->setPositionProviderPlugin( 0 );
d->m_widget->update();
}
@@ -751,7 +750,7 @@
PositionProviderPlugin* instance = plugin->newInstance();
PositionTracking *tracking = d->m_widget->model()->positionTracking();
tracking->setPositionProviderPlugin( instance );
- d->m_widget->map()->model()->gpsLayer()->setVisible( true );
+ d->m_widget->map()->setShowGps( true );
d->m_widget->update();
return;
}
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.cpp #1135201:1135202
@@ -57,7 +57,6 @@
#include "TextureColorizer.h"
#include "ViewParams.h"
#include "ViewportParams.h"
-#include "gps/GpsLayer.h"
#include "gps/PositionTracking.h"
using namespace Marble;
@@ -716,7 +715,7 @@
bool MarbleMap::showGps() const
{
- return d->m_model->gpsLayer()->visible();
+ return d->m_viewParams.showGps();
}
bool MarbleMap::showFrameRate() const
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.cpp #1135201:1135202
@@ -281,26 +281,6 @@
mDebug() << "Model deleted:" << this;
}
-bool MarbleModel::showGps() const
-{
- return d->m_gpsLayer->visible();
-}
-
-void MarbleModel::setShowGps( bool visible )
-{
- d->m_gpsLayer->setVisible( visible );
-}
-
-void MarbleModel::startPolling( int time )
-{
- d->m_timer->start( time );
-}
-
-void MarbleModel::stopPolling()
-{
- d->m_timer->stop();
-}
-
QString MarbleModel::mapThemeId() const
{
QString mapThemeId = "";
@@ -713,11 +693,6 @@
return d->m_placemarkLayout;
}
-GpsLayer *MarbleModel::gpsLayer() const
-{
- return d->m_gpsLayer;
-}
-
GpxFileModel *MarbleModel::gpxFileModel() const
{
return d->m_gpxFileModel;
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.h #1135201:1135202
@@ -51,7 +51,6 @@
class GeoPainter;
class TileCoordsPyramid;
class FileViewModel;
-class GpsLayer;
class GpxFileModel;
class PositionTracking;
class HttpDownloadManager;
@@ -218,37 +217,10 @@
AbstractScanlineTextureMapper *textureMapper() const;
- GpsLayer *gpsLayer() const;
GpxFileModel *gpxFileModel() const;
FileViewModel *fileViewModel() const;
PositionTracking *positionTracking() const;
- /**
- * @brief Return whether the Gps Data is visible.
- * @return The Gps Data visibility.
- */
- bool showGps() const;
-
- /**
- * @brief Set whether the Gps Data is visible.
- * @param visible visibility of the Gps Data.
- */
- void setShowGps( bool visible );
-
- /**
- * @brief Start the model's timer polling
- * @param time the amount of milliseconds between each poll
- *
- * This is default behaviour so does not need to be started unless
- * it was previously stopped
- */
- void startPolling( int time = 1000 );
-
- /**
- * @brief stop the model from polling
- */
- void stopPolling();
-
qreal planetRadius() const;
QString planetName() const;
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.cpp #1135201:1135202
@@ -47,7 +47,6 @@
#include "TileCreatorDialog.h"
#include "ViewParams.h"
#include "ViewportParams.h"
-#include "gps/GpsLayer.h"
#include "gps/PositionTracking.h"
--- trunk/KDE/kdeedu/marble/src/lib/gps/GpsLayer.cpp #1135201:1135202
@@ -17,6 +17,7 @@
#include <QtCore/QString>
#include "MarbleDebug.h"
+#include "ViewParams.h"
#include <QtGui/QRegion>
#include <cmath>
@@ -42,7 +43,7 @@
const QSize &canvasSize, ViewParams *viewParams )
{
painter->save();
- if ( visible() ) {
+ if ( viewParams->showGps() ) {
QRegion temp; // useless variable
m_tracking->update( canvasSize, viewParams, temp );
m_tracking->draw( painter, canvasSize, viewParams );
More information about the Marble-commits
mailing list