[Marble-commits] KDE/kdeedu/marble/src/lib
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Sat Dec 18 13:15:17 CET 2010
SVN commit 1207515 by beschow:
pass a TileLoader rather than a HttpDownloadManager to the StackedTileLoader ctor
* instantiate TileLoader in TextureLayer
M +5 -7 StackedTileLoader.cpp
M +2 -2 StackedTileLoader.h
M +4 -2 TextureLayer.cpp
--- trunk/KDE/kdeedu/marble/src/lib/StackedTileLoader.cpp #1207514:1207515
@@ -59,10 +59,10 @@
class StackedTileLoaderPrivate
{
public:
- StackedTileLoaderPrivate()
+ StackedTileLoaderPrivate( TileLoader *tileLoader )
: m_datasetProvider( 0 ),
m_mapThemeManager( 0 ),
- m_tileLoader( 0 ),
+ m_tileLoader( tileLoader ),
m_textureLayerSettings( 0 )
{
m_tileCache.setMaxCost( 20000 * 1024 ); // Cache size measured in bytes
@@ -75,7 +75,7 @@
// TODO: comment about uint hash key
QHash<uint, GeoSceneLayer const *> m_sceneLayers;
QHash<uint, GeoSceneTexture const *> m_textureLayers;
- TileLoader *m_tileLoader;
+ TileLoader *const m_tileLoader;
QHash <TileId, StackedTile*> m_tilesOnDisplay;
QCache <TileId, StackedTile> m_tileCache;
// we cannot use a const GeoSceneGroup because of QObject connects/disconnects
@@ -92,15 +92,14 @@
}
StackedTileLoader::StackedTileLoader( MapThemeManager const * const mapThemeManager,
- HttpDownloadManager * const downloadManager,
+ TileLoader * const tileLoader,
TextureLayer * const parent )
- : d( new StackedTileLoaderPrivate ),
+ : d( new StackedTileLoaderPrivate( tileLoader ) ),
m_parent( parent )
{
d->m_mapThemeManager = mapThemeManager;
connect( d->m_mapThemeManager, SIGNAL( themesChanged() ),
this, SLOT( updateTextureLayers() ) );
- d->m_tileLoader = new TileLoader( downloadManager );
updateTextureLayers();
connect( d->m_tileLoader, SIGNAL( tileCompleted( TileId, TileId )),
SLOT( updateTile( TileId, TileId )));
@@ -110,7 +109,6 @@
{
flush();
d->m_tileCache.clear();
- delete d->m_tileLoader;
delete d;
}
--- trunk/KDE/kdeedu/marble/src/lib/StackedTileLoader.h #1207514:1207515
@@ -35,12 +35,12 @@
{
class StackedTile;
-class HttpDownloadManager;
class MapThemeManager;
class GeoSceneGroup;
class GeoSceneLayer;
class GeoSceneTexture;
class TextureLayer;
+class TileLoader;
class StackedTileLoaderPrivate;
@@ -69,7 +69,7 @@
* the tiles from a remote resource.
*/
StackedTileLoader( MapThemeManager const * const mapThemeManager,
- HttpDownloadManager * const downloadManager, TextureLayer * const parent );
+ TileLoader * const tileLoader, TextureLayer * const parent );
virtual ~StackedTileLoader();
void setTextureLayerSettings( GeoSceneGroup * const textureLayerSettings );
--- trunk/KDE/kdeedu/marble/src/lib/TextureLayer.cpp #1207514:1207515
@@ -31,6 +31,7 @@
#include "StackedTile.h"
#include "StackedTileLoader.h"
#include "TextureColorizer.h"
+#include "TileLoader.h"
#include "VectorComposer.h"
#include "ViewParams.h"
@@ -50,6 +51,7 @@
public:
TextureLayer *const m_parent;
TextureColorizer m_texcolorizer;
+ TileLoader m_loader;
StackedTileLoader m_tileLoader;
MergedLayerDecorator m_layerDecorator;
VectorComposer m_veccomposer;
@@ -61,13 +63,13 @@
TextureLayer::Private::Private( MapThemeManager *mapThemeManager, HttpDownloadManager *downloadManager, SunLocator *sunLocator, TextureLayer *parent )
: m_parent( parent )
, m_texcolorizer()
- , m_tileLoader( mapThemeManager, downloadManager, parent )
+ , m_loader( downloadManager )
+ , m_tileLoader( mapThemeManager, &m_loader, parent )
, m_layerDecorator( &m_tileLoader, sunLocator )
, m_veccomposer( parent )
, m_texmapper( 0 )
, m_mapTheme( 0 )
, m_justModified( true )
-
{
}
More information about the Marble-commits
mailing list