From a2ee0cfd799f563f292e6b40ca460e05819fd0fd Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Thu, 8 Jul 2010 15:33:37 +1000 Subject: Don't show warning for attempts to load pixmaps asynchronously (should be handled by image providers, elements shouldn't have to know about the capabilities) --- src/declarative/util/qdeclarativepixmapcache.cpp | 3 +-- .../qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp index f729ced..00dd922 100644 --- a/src/declarative/util/qdeclarativepixmapcache.cpp +++ b/src/declarative/util/qdeclarativepixmapcache.cpp @@ -952,10 +952,9 @@ void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const if (iter == store->m_cache.end()) { if (async) { + // pixmaps can only be loaded synchronously if (url.scheme() == QLatin1String("image") && QDeclarativeEnginePrivate::get(engine)->getImageProviderType(url) == QDeclarativeImageProvider::Pixmap) { - qWarning().nospace() << "Pixmaps must be loaded synchronously, ignoring asynchronous property for Image with source: " - << url.toString(); async = false; } } diff --git a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp index 9d62f22..e0b46f0 100644 --- a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp +++ b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp @@ -256,9 +256,7 @@ void tst_qdeclarativeimageprovider::requestPixmap_async() engine.addImageProvider("test", provider); QVERIFY(engine.imageProvider("test") != 0); - QTest::ignoreMessage(QtWarningMsg, - "Pixmaps must be loaded synchronously, ignoring asynchronous property for Image with source: \"image://test/pixmap-async-test.png\""); - + // pixmaps are loaded synchronously regardless of 'asynchronous' value QString componentStr = "import Qt 4.7\nImage { asynchronous: true; source: \"image://test/pixmap-async-test.png\" }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); -- cgit v0.12