[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/marble/src/lib/geodata/scene
From:       Bernhard Beschow <bbeschow () cs ! tu-berlin ! de>
Date:       2010-07-27 10:35:45
Message-ID: 20100727103545.7E83EAC73E () svn ! kde ! org
[Download RAW message or body]

SVN commit 1155434 by beschow:

const'ify GeoSceneTexture::downloadUrl()

Even though this method changes the internal state, it may be const because the \
compiler is forced to invoke this method for different TileIds.

 M  +3 -1      GeoSceneTexture.cpp  
 M  +8 -5      GeoSceneTexture.h  


--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneTexture.cpp \
#1155433:1155434 @@ -142,7 +142,9 @@
     m_projection = projection;
 }
 
-QUrl GeoSceneTexture::downloadUrl( const TileId &id )
+// Even though this method changes the internal state, it may be const
+// because the compiler is forced to invoke this method for different TileIds.
+QUrl GeoSceneTexture::downloadUrl( const TileId &id ) const
 {
     // default download url
     if ( m_downloadUrls.empty() )
--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneTexture.h #1155433:1155434
@@ -81,10 +81,13 @@
     Blending const * blending() const;
     void setBlending( Blending const * const );
 
-    // this method is a little more than just a stupid getter,
-    // it implements the round robin for the tile servers.
-    // on each invocation the next url is returned
-    QUrl downloadUrl( const TileId & );
+    /**
+     * Creates a download URL for the given tile id.
+     *
+     * It implements the round robin for the tile servers.
+     * On each invocation the next url is returned.
+     */
+    QUrl downloadUrl( const TileId & ) const;
     void addDownloadUrl( const QUrl & );
 
     QString relativeTileFileName( const TileId & ) const;
@@ -115,7 +118,7 @@
     QVector<QUrl> m_downloadUrls;
 
     /// Points to next Url for the round robin algorithm
-    QVector<QUrl>::const_iterator m_nextUrl;
+    mutable QVector<QUrl>::const_iterator m_nextUrl;
     QList<DownloadPolicy *> m_downloadPolicies;
 };
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic