[Marble-commits] KDE/kdeedu/marble/src/lib
Dennis Nienhüser
earthwings at gentoo.org
Sun Nov 28 16:31:49 CET 2010
SVN commit 1201749 by nienhueser:
Loading citylights.dgml does not trigger inital tile creation, so we need to run it explicitly if base tiles are not there yet.
CCBUG: 258058
M +25 -2 MergedLayerDecorator.cpp
--- trunk/KDE/kdeedu/marble/src/lib/MergedLayerDecorator.cpp #1201748:1201749
@@ -17,8 +17,6 @@
#include "MergedLayerDecorator.h"
-#include <QtGui/QPainter>
-
#include "SunLocator.h"
#include "StackedTileLoader.h"
#include "global.h"
@@ -32,7 +30,12 @@
#include "StackedTile.h"
#include "TileLoaderHelper.h"
#include "Planet.h"
+#include "TileCreator.h"
+#include "TileCreatorDialog.h"
+#include <QtGui/QPainter>
+#include <QtCore/QPointer>
+
using namespace Marble;
MergedLayerDecorator::MergedLayerDecorator( StackedTileLoader * const tileLoader,
@@ -57,6 +60,26 @@
m_cityLightsTheme = MapThemeManager::loadMapTheme( "earth/citylights/citylights.dgml" );
if (m_cityLightsTheme) {
QString cityLightsId = m_cityLightsTheme->head()->theme();
+ GeoSceneLayer* layer = m_cityLightsTheme->map()->layer( cityLightsId );
+ GeoSceneTexture *texture =
+ static_cast<GeoSceneTexture*>( layer->groundDataset() );
+
+ QString sourceDir = texture->sourceDir();
+ QString installMap = texture->installMap();
+ if ( !m_tileLoader->baseTilesAvailable( layer ) ) {
+ TileCreator *tileCreator = new TileCreator(
+ sourceDir,
+ installMap,
+ "false" );
+
+ QPointer<TileCreatorDialog> tileCreatorDlg = new TileCreatorDialog( tileCreator, 0 );
+ tileCreatorDlg->setSummary( m_cityLightsTheme->head()->name(),
+ m_cityLightsTheme->head()->description() );
+ tileCreatorDlg->exec();
+ qDebug("Tile creation completed");
+ delete tileCreatorDlg;
+ }
+
m_cityLightsTextureLayer = static_cast<GeoSceneTexture*>(
m_cityLightsTheme->map()->layer( cityLightsId )->datasets().first() );
}
More information about the Marble-commits
mailing list