Print sprite errors only once
authorAlan Alpert <alan.alpert@nokia.com>
Tue, 1 May 2012 06:19:06 +0000 (16:19 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 14 May 2012 03:36:33 +0000 (05:36 +0200)
Change-Id: I1dfb829d47cfdb5c5af3f3bc5956483ea6ef6314
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
src/quick/items/qquickspriteengine.cpp
src/quick/items/qquickspriteengine_p.h

index 1763d7a..724d134 100644 (file)
@@ -348,6 +348,7 @@ void QQuickSpriteEngine::startAssemblingImage()
     if (m_startedImageAssembly)
         return;
     m_loaded = false;
+    m_errorsPrinted = false;
 
     //This could also trigger the start of the image loading in Sprites, however that currently happens in Sprite::setSource
 
@@ -370,10 +371,12 @@ void QQuickSpriteEngine::startAssemblingImage()
 QImage QQuickSpriteEngine::assembledImage()
 {
     QQuickPixmap::Status stat = status();
-    if (stat == QQuickPixmap::Error)
+    if (!m_errorsPrinted && stat == QQuickPixmap::Error) {
         foreach (QQuickSprite* s, m_sprites)
             if (s->m_pix.isError())
                 qmlInfo(s) << s->m_pix.error();
+        m_errorsPrinted = true;
+    }
 
     if (stat != QQuickPixmap::Ready)
         return QImage();
index d78a103..996ed5e 100644 (file)
@@ -295,6 +295,7 @@ private:
     QList<QQuickSprite*> m_sprites;
     bool m_startedImageAssembly;
     bool m_loaded;
+    bool m_errorsPrinted;
 };
 
 //Common use is to have your own list property which is transparently an engine