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

Jens-Michael Hoffmann jensmh at gmx.de
Fri May 14 17:47:06 CEST 2010


SVN commit 1126672 by jmhoffmann:

Fix delayed update of tile level statusbar label.

AbstractScanlineTextureMapper got a tileLevelChanged signal and the
m_tileLevel member was moved to the private section.
For convenience MarbleModel relays the signal.

 M  +3 -2      lib/AbstractScanlineTextureMapper.cpp  
 M  +2 -1      lib/AbstractScanlineTextureMapper.h  
 M  +2 -1      lib/MarbleModel.cpp  
 M  +1 -1      lib/MarbleModel.h  
 M  +8 -4      marble_part.cpp  
 M  +1 -1      marble_part.h  


--- trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.cpp #1126671:1126672
@@ -38,11 +38,11 @@
       m_textureLayer( textureLayer ),
       m_tileLoader( tileLoader ),
       m_tile( 0 ),
-      m_tileLevel( 0 ),
       m_maxTileLevel( 0 ),
       m_tilePosX( 0 ),
       m_tilePosY( 0 ),
       m_nBest( 0 ),
+      m_tileLevel( 0 ),
       m_globalWidth( 0 ),
       m_globalHeight( 0 ),
       m_normGlobalWidth( 0.0 ),
@@ -123,9 +123,10 @@
     // the center to the upper left corner and subtract the tile position 
     // in that coordinate system. In total this equals a coordinate 
     // transformation to tile coordinates.
-  
     m_toTileCoordinatesLon = (qreal)(m_globalWidth / 2 - m_tilePosX);
     m_toTileCoordinatesLat = (qreal)(m_globalHeight / 2 - m_tilePosY);
+
+    emit tileLevelChanged( m_tileLevel );
 }
 
 
--- trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.h #1126671:1126672
@@ -53,6 +53,7 @@
 
  Q_SIGNALS:
     void mapChanged();
+    void tileLevelChanged( int newTileLevel );
 
  private Q_SLOTS:
     void notifyMapChanged();
@@ -129,7 +130,6 @@
 
     StackedTile *m_tile;
 
-    int          m_tileLevel;
     int          m_maxTileLevel;
 
     int          m_previousRadius;
@@ -149,6 +149,7 @@
     void initGlobalHeight();
     void initTileSize();
 
+    int         m_tileLevel;
     int         m_globalWidth;
     int         m_globalHeight;
     qreal       m_normGlobalWidth;
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.cpp #1126671:1126672
@@ -529,7 +529,8 @@
         default:
             d->m_texmapper = 0;
     }
-
+    Q_ASSERT( d->m_texmapper );
+    connect( d->m_texmapper, SIGNAL( tileLevelChanged( int )), SIGNAL( tileLevelChanged( int )));
     connect( d->m_texmapper, SIGNAL( mapChanged() ),
              this,           SLOT( notifyModelChanged() ) );
 }
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.h #1126671:1126672
@@ -334,8 +334,8 @@
      * @see  zoomView()
      */
     void creatingTilesStart( TileCreator*, const QString& name, const QString& description );
+    void tileLevelChanged( int newTileLevel );
 
-
     /**
      * @brief Signal that the map theme has changed, and to which theme.
      * @param mapTheme the identifier of the new map theme.
--- trunk/KDE/kdeedu/marble/src/marble_part.cpp #1126671:1126672
@@ -804,9 +804,13 @@
     updateStatusBar();
 }
 
-void MarblePart::showZoomLevel()
+void MarblePart::showZoomLevel( const int tileLevel )
 {
-    updateTileZoomLevel();
+    if ( tileLevel == -1 )
+        m_tileZoomLevel = NOT_AVAILABLE;
+    else {
+        m_tileZoomLevel.setNum( tileLevel );
+    }
     updateStatusBar();
 }
 
@@ -882,8 +886,8 @@
              this,                          SLOT( showPosition( QString ) ) );
     connect( m_controlView->marbleWidget(), SIGNAL( distanceChanged( QString ) ),
              this,                          SLOT( showDistance( QString ) ) );
-    connect( m_controlView->marbleWidget(), SIGNAL( zoomChanged( int ) ),
-             this,                          SLOT( showZoomLevel() ) );
+    connect( m_controlView->marbleWidget()->model(), SIGNAL( tileLevelChanged( int )),
+             SLOT( showZoomLevel( int )));
     connect( m_controlView->marbleWidget()->model(), SIGNAL( themeChanged( QString )),
              this, SLOT( mapThemeChanged( QString )), Qt::QueuedConnection );
 
--- trunk/KDE/kdeedu/marble/src/marble_part.h #1126671:1126672
@@ -57,7 +57,7 @@
     bool  openFile();
     void  showPosition( const QString& position);
     void  showDistance( const QString& position);
-    void  showZoomLevel();
+    void  showZoomLevel( const int );
     void  mapThemeChanged( const QString& newMapTheme );
     void  createPluginMenus();
 


More information about the Marble-commits mailing list