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

Bernhard Beschow bbeschow at cs.tu-berlin.de
Tue Jul 27 12:35:47 CEST 2010


SVN commit 1155435 by beschow:

const'ify GeoSceneTexture in TileLoader and StackedTileLoader

 M  +2 -2      StackedTileLoader.cpp  
 M  +1 -8      TileLoader.cpp  
 M  +3 -4      TileLoader.h  


--- trunk/KDE/kdeedu/marble/src/lib/StackedTileLoader.cpp #1155434:1155435
@@ -74,7 +74,7 @@
     MapThemeManager const *m_mapThemeManager;
     // TODO: comment about uint hash key
     QHash<uint, GeoSceneLayer const *> m_sceneLayers;
-    QHash<uint, GeoSceneTexture*> m_textureLayers;
+    QHash<uint, GeoSceneTexture const *> m_textureLayers;
     TileLoader *m_tileLoader;
     QHash <TileId, StackedTile*>  m_tilesOnDisplay;
     QCache <TileId, StackedTile>  m_tileCache;
@@ -484,7 +484,7 @@
         QVector<GeoSceneAbstractDataset *>::const_iterator pos = layers.constBegin();
         QVector<GeoSceneAbstractDataset *>::const_iterator const end = layers.constEnd();
         for (; pos != end; ++pos ) {
-            GeoSceneTexture * const textureLayer = dynamic_cast<GeoSceneTexture *>( *pos );
+            GeoSceneTexture const * const textureLayer = dynamic_cast<GeoSceneTexture *>( *pos );
             if ( !textureLayer ) {
                 mDebug() << "ignoring dataset, is not a texture layer";
                 continue;
--- trunk/KDE/kdeedu/marble/src/lib/TileLoader.cpp #1155434:1155435
@@ -170,13 +170,6 @@
     return textureLayer;
 }
 
-inline GeoSceneTexture * TileLoader::findTextureLayer( TileId const & id )
-{
-    GeoSceneTexture * const textureLayer = m_textureLayers.value( id.mapThemeIdHash(), 0 );
-    Q_ASSERT( textureLayer );
-    return textureLayer;
-}
-
 QString TileLoader::tileFileName( TileId const & tileId ) const
 {
     GeoSceneTexture const * const textureLayer = findTextureLayer( tileId );
@@ -185,7 +178,7 @@
 
 void TileLoader::triggerDownload( TileId const & id, DownloadUsage const usage )
 {
-    GeoSceneTexture * const textureLayer = findTextureLayer( id );
+    GeoSceneTexture const * const textureLayer = findTextureLayer( id );
     QUrl const sourceUrl = textureLayer->downloadUrl( id );
     QString const destFileName = textureLayer->relativeTileFileName( id );
     emit downloadTile( sourceUrl, destFileName, id.toString(), usage );
--- trunk/KDE/kdeedu/marble/src/lib/TileLoader.h #1155434:1155435
@@ -48,7 +48,7 @@
     void reloadTile( QSharedPointer<TextureTile> const & tile, DownloadUsage const );
     void downloadTile( TileId const & tileId );
 
-    void setTextureLayers( QHash<uint, GeoSceneTexture*> const & );
+    void setTextureLayers( QHash<uint, GeoSceneTexture const *> const & );
 
  public Q_SLOTS:
     void updateTile( QByteArray const & imageData, QString const & tileId );
@@ -63,20 +63,19 @@
 
  private:
     GeoSceneTexture const * findTextureLayer( TileId const & ) const;
-    GeoSceneTexture * findTextureLayer( TileId const & );
     QString tileFileName( TileId const & ) const;
     void triggerDownload( TileId const &, DownloadUsage const );
     QImage * scaledLowerLevelTile( TileId const & );
 
     // TODO: comment about uint hash key
-    QHash<uint, GeoSceneTexture*> m_textureLayers;
+    QHash<uint, GeoSceneTexture const *> m_textureLayers;
 
     // contains tiles, for which a download has been triggered
     // because the tile was not there at all or is expired.
     QHash<TileId, QSharedPointer<TextureTile> > m_waitingForUpdate;
 };
 
-inline void TileLoader::setTextureLayers( QHash<uint, GeoSceneTexture*> const & layers )
+inline void TileLoader::setTextureLayers( QHash<uint, GeoSceneTexture const *> const & layers )
 {
     m_textureLayers = layers;
 }


More information about the Marble-commits mailing list