[Marble-commits] KDE/kdeedu/marble/src/lib
Dennis Nienhüser
earthwings at gentoo.org
Wed Oct 6 21:06:19 CEST 2010
SVN commit 1183269 by nienhueser:
Have MarbleWidget create and own the RoutingLayer. Fixes routes not visible in applications embedding a MarbleWidget.
CCBUG: 248086
M +19 -1 MarbleWidget.cpp
M +3 -0 MarbleWidget.h
M +1 -6 routing/RoutingWidget.cpp
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.cpp #1183268:1183269
@@ -47,6 +47,9 @@
#include "TileCreatorDialog.h"
#include "ViewportParams.h"
#include "BookmarkManager.h"
+#include "routing/RoutingLayer.h"
+#include "routing/RoutingManager.h"
+
namespace Marble
{
@@ -73,7 +76,8 @@
m_zoomStep( 40 ),
m_inputhandler( 0 ),
m_physics( new MarblePhysics( parent ) ),
- m_repaintTimer()
+ m_repaintTimer(),
+ m_routingLayer( 0 )
{
}
@@ -120,6 +124,8 @@
// For scheduling repaints
QTimer m_repaintTimer;
+
+ RoutingLayer *m_routingLayer;
};
@@ -238,6 +244,13 @@
m_widget->connect( m_model, SIGNAL( renderPluginInitialized( RenderPlugin * ) ),
m_widget, SIGNAL( renderPluginInitialized( RenderPlugin * ) ) );
+
+ m_routingLayer = new RoutingLayer( m_widget, m_widget );
+ m_routingLayer->setRouteRequest( m_model->routingManager()->routeRequest() );
+ m_model->addLayer( m_routingLayer );
+
+ m_widget->connect( m_routingLayer, SIGNAL( routeDirty() ),
+ m_model->routingManager(), SLOT( updateRoute() ) );
}
void MarbleWidgetPrivate::moveByStep( int stepsRight, int stepsDown, FlyToMode mode )
@@ -1343,6 +1356,11 @@
d->m_model->bookmarkManager()->addNewBookmarkFolder( name );
}
+RoutingLayer* MarbleWidget::routingLayer()
+{
+ return d->m_routingLayer;
}
+}
+
#include "MarbleWidget.moc"
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.h #1183268:1183269
@@ -49,6 +49,7 @@
class MarbleWidgetInputHandler;
class MarbleWidgetPrivate;
class RenderPlugin;
+class RoutingLayer;
class SunLocator;
class TileCreator;
class GeoDataPlacemark;
@@ -567,6 +568,8 @@
void addNewBookmarkFolder( const QString& name ) const;
+ RoutingLayer* routingLayer();
+
public Q_SLOTS:
void updateSun();
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingWidget.cpp #1183268:1183269
@@ -181,20 +181,15 @@
d->m_ui.routeComboBox->setVisible( false );
d->m_widget = marbleWidget;
- //d->m_routingManager = new RoutingManager( d->m_widget, this );
d->m_routingManager = d->m_widget->model()->routingManager();
d->m_routeRequest = d->m_widget->model()->routingManager()->routeRequest();
d->m_ui.routeComboBox->setModel( d->m_routingManager->alternativeRoutesModel() );
- d->m_routingLayer = new RoutingLayer( d->m_widget, this );
- d->m_routingLayer->setRouteRequest( d->m_routeRequest );
+ d->m_routingLayer = d->m_widget->routingLayer();
d->m_routingLayer->synchronizeAlternativeRoutesWith( d->m_routingManager->alternativeRoutesModel(), d->m_ui.routeComboBox );
- d->m_widget->model()->addLayer( d->m_routingLayer );
connect( d->m_routingManager->alternativeRoutesModel(), SIGNAL( currentRouteChanged( GeoDataDocument* ) ),
d->m_widget, SLOT( repaint() ) );
- connect( d->m_routingLayer, SIGNAL( routeDirty() ),
- d->m_routingManager, SLOT( updateRoute() ) );
connect( d->m_routingLayer, SIGNAL( placemarkSelected( QModelIndex ) ),
this, SLOT( activatePlacemark( QModelIndex ) ) );
connect( d->m_routingLayer, SIGNAL( pointSelected( GeoDataCoordinates ) ),
More information about the Marble-commits
mailing list