Remove warning messages for canvasitem tests
authorCharles Yin <charles.yin@nokia.com>
Wed, 7 Dec 2011 03:04:20 +0000 (13:04 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 7 Dec 2011 03:21:06 +0000 (04:21 +0100)
1) The null image warnings can be safely ignored as the images are
   expected to be null
2) Check the isLoading() before calling QDeclarativePixmap::connectFinished()

Change-Id: I58339f40495fb62c73b217aca35cdd7effd8c917
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/quick/items/context2d/qquickcanvasitem.cpp
tests/auto/qtquick2/qquickcanvasitem/data/tst_drawimage.qml

index 32809ba..e8decdc 100644 (file)
@@ -577,7 +577,8 @@ void QQuickCanvasItem::loadImage(const QUrl& url)
         pix->load(qmlEngine(this)
                 , fullPathUrl
                 , QDeclarativePixmap::Cache | QDeclarativePixmap::Asynchronous);
-        pix->connectFinished(this, SIGNAL(imageLoaded()));
+        if (pix->isLoading())
+            pix->connectFinished(this, SIGNAL(imageLoaded()));
     }
 }
 /*!
index 3752f52..102217d 100644 (file)
@@ -129,6 +129,8 @@ Canvas {
        function test_self() {
            var ctx = canvas.getContext('2d');
            ctx.reset();
+           ignoreWarning("QImage::scaled: Image is a null image");
+           ignoreWarning("QImage::scaled: Image is a null image");
 
            ctx.fillStyle = '#0f0';
            ctx.fillRect(0, 0, 50, 50);
@@ -258,7 +260,10 @@ Canvas {
        function test_nonfinite() {
            var ctx = canvas.getContext('2d');
            ctx.reset();
-
+           ignoreWarning("QImage::scaled: Image is a null image");
+           ignoreWarning("QImage::scaled: Image is a null image");
+           ignoreWarning("QImage::scaled: Image is a null image");
+           ignoreWarning("QImage::scaled: Image is a null image");
            ctx.fillStyle = '#0f0';
            ctx.fillRect(0, 0, 100, 50);
            var red = 'red.png';