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

List:       kde-commits
Subject:    [marble] src/lib: raise a qWarning if unknown blending is specified in the .dgml file
From:       Bernhard Beschow <bbeschow () cs ! tu-berlin ! de>
Date:       2012-11-05 15:38:52
Message-ID: 20121105153852.61158A60C4 () git ! kde ! org
[Download RAW message or body]

Git commit aa98fde75f9687125154e39451759a293362e148 by Bernhard Beschow.
Committed on 05/11/2012 at 13:17.
Pushed by beschow into branch 'master'.

raise a qWarning if unknown blending is specified in the .dgml file

An unknown blending usually indicates a faulty .dgml file, which is fixable on the \
user side. Especially when creating a new map theme for Marble, raising a warning is \
very useful.

M  +0    -3    src/lib/MergedLayerDecorator.cpp
M  +6    -2    src/lib/blendings/BlendingFactory.cpp

http://commits.kde.org/marble/aa98fde75f9687125154e39451759a293362e148

diff --git a/src/lib/MergedLayerDecorator.cpp b/src/lib/MergedLayerDecorator.cpp
index 119a3e2..0e790e7 100644
--- a/src/lib/MergedLayerDecorator.cpp
+++ b/src/lib/MergedLayerDecorator.cpp
@@ -141,9 +141,6 @@ StackedTile *MergedLayerDecorator::loadTile( const TileId \
&stackedTileId, const  
         const QImage tileImage = d->m_tileLoader->loadTile( textureLayer, tileId, \
                DownloadBrowse );
         const Blending *blending = d->m_blendingFactory.findBlending( \
                textureLayer->blending() );
-        if ( blending == 0 && !textureLayer->blending().isEmpty() ) {
-            mDebug() << Q_FUNC_INFO << "could not find blending" << \
                textureLayer->blending();
-        }
         QSharedPointer<TextureTile> tile( new TextureTile( tileId, tileImage, \
blending ) );  tiles.append( tile );
     }
diff --git a/src/lib/blendings/BlendingFactory.cpp \
b/src/lib/blendings/BlendingFactory.cpp index 1c5894a..4ffc576 100644
--- a/src/lib/blendings/BlendingFactory.cpp
+++ b/src/lib/blendings/BlendingFactory.cpp
@@ -15,9 +15,10 @@
 
 #include "BlendingFactory.h"
 
+#include <QtCore/QDebug>
+
 #include "blendings/SunLightBlending.h"
 #include "BlendingAlgorithms.h"
-#include "MarbleDebug.h"
 
 namespace Marble
 {
@@ -29,9 +30,12 @@ void BlendingFactory::setLevelZeroLayout( int levelZeroColumns, \
int levelZeroRow  
 Blending const * BlendingFactory::findBlending( QString const & name ) const
 {
+    if ( name.isEmpty() )
+        return 0;
+
     Blending const * const result = m_blendings.value( name, 0 );
     if ( !result )
-        mDebug() << "BlendingFactory::findBlending: unknown blending:" << name;
+        qWarning() << "Unknown blending" << name << "specified in .dgml file. Please \
fix the .dgml file.";  return result;
 }
 


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

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