diff options
author | David Faure <david.faure@kdab.com> | 2014-07-25 18:29:19 +0200 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2014-07-26 00:46:13 +0200 |
commit | 8c80dd6a9893c6e323ae69b651efd7b629b2714c (patch) | |
tree | 843aa76e5125aa082419140d19e121bbb019ebf3 /tests/auto/declarative/qdeclarativeimageprovider | |
parent | 302687f21c99643a2dd1930a19fde66ba725661e (diff) |
QDeclarativeError::toString: improve handling of empty urls.
"file::2:23: ..." is strange to read. Show "<Unknown File>:2:23: ..." instead,
by treating empty urls (including "file:") as unknown, and by still showing
line and column numbers in such a case.
This change makes it possible for QUrl::fromLocalFile("") to return an
empty url rather than "file:", which this module was relying upon in the tests.
Change-Id: Id6d8aaa73673283cb65cbd1316dca77f859a3f8f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeimageprovider')
-rw-r--r-- | tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp index a4b305c8..6a32a958 100644 --- a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp +++ b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp @@ -200,11 +200,11 @@ void tst_qdeclarativeimageprovider::fillRequestTestsData(const QString &id) QTest::newRow(QTest::toString(id + " missing")) << "image://test/no-such-file.png" << "no-such-file.png" << "" << QSize(100,100) - << "file::2:1: QML Image: Failed to get image from provider: image://test/no-such-file.png"; + << "<Unknown File>:2:1: QML Image: Failed to get image from provider: image://test/no-such-file.png"; QTest::newRow(QTest::toString(id + " unknown provider")) << "image://bogus/exists.png" << "" << "" << QSize() - << "file::2:1: QML Image: Failed to get image from provider: image://bogus/exists.png"; + << "<Unknown File>:2:1: QML Image: Failed to get image from provider: image://bogus/exists.png"; } void tst_qdeclarativeimageprovider::runTest(bool async, QDeclarativeImageProvider *provider) @@ -344,7 +344,7 @@ void tst_qdeclarativeimageprovider::removeProvider() // remove the provider and confirm QString fileName = newImageFileName(); - QString error("file::2:1: QML Image: Failed to get image from provider: " + fileName); + QString error("<Unknown File>:2:1: QML Image: Failed to get image from provider: " + fileName); QTest::ignoreMessage(QtWarningMsg, error.toUtf8()); engine.removeImageProvider("test"); |