[Marble-commits] KDE/kdeedu/marble/src/lib

Dennis Nienhüser earthwings at gentoo.org
Sat Nov 20 15:07:31 CET 2010


SVN commit 1199058 by nienhueser:

Don't create a second, inaccessible routing widget on Maemo.

 M  +7 -3      MarbleControlBox.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/MarbleControlBox.cpp #1199057:1199058
@@ -111,11 +111,11 @@
 {
     d->m_widget = widget;
 
+    bool const smallScreen = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen;
+    if ( !smallScreen ) {
     d->m_routingWidget = new RoutingWidget( widget, this );
-
-    //d->uiWidget.toolBox->addItem( d->m_routingWidget, tr( "Routing" ) );
-
     addItem( d->m_routingWidget, tr( "Routing" ) );
+    }
 
     d->m_fileViewWidget->setMarbleWidget( widget );
     d->m_legendWidget->setMarbleWidget( widget );
@@ -193,9 +193,11 @@
 
 void MarbleControlBox::setRoutingTabShown( bool show )
 {
+    if ( d->m_routingWidget ) {
     QString  title = tr( "Routing" );
     setWidgetTabShown( d->m_routingWidget, 5, show, title );
 }
+}
 
 void MarbleControlBox::selectTheme( const QString &theme )
 {
@@ -205,8 +207,10 @@
         return;
 
     QString selectedId = d->m_widget->mapTheme()->head()->target();
+    if ( d->m_routingWidget ) {
     int routingIndex = indexOf( d->m_routingWidget );
     setItemEnabled( routingIndex, selectedId == "earth" );
+    }
     int locationIndex = indexOf( d->m_currentLocationWidget );
     if ( locationIndex >= 0 ) {
         setItemEnabled( locationIndex, selectedId == "earth" );


More information about the Marble-commits mailing list