From: Charles Yin Date: Wed, 7 Dec 2011 03:04:20 +0000 (+1000) Subject: Remove warning messages for canvasitem tests X-Git-Tag: qt-v5.0.0-alpha1~899 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=65b2bcf4e6317d29294a389531e8d63d33f2a5b8;p=profile%2Fivi%2Fqtdeclarative.git Remove warning messages for canvasitem tests 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 --- diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index 32809ba..e8decdc 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -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())); } } /*! diff --git a/tests/auto/qtquick2/qquickcanvasitem/data/tst_drawimage.qml b/tests/auto/qtquick2/qquickcanvasitem/data/tst_drawimage.qml index 3752f52..102217d 100644 --- a/tests/auto/qtquick2/qquickcanvasitem/data/tst_drawimage.qml +++ b/tests/auto/qtquick2/qquickcanvasitem/data/tst_drawimage.qml @@ -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';