diff options
author | David Faure <david.faure@kdab.com> | 2014-07-11 16:15:01 +0200 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2014-07-24 15:15:43 +0200 |
commit | aad255f6d5e79f496e93c9e758504a1d2c8a2467 (patch) | |
tree | 02a1b6f1225b985bcd9b42e593203d18d0cfce0a /tests/auto/quick/qquickimageprovider | |
parent | a38b0863f88bc89733c213cf6f73abc7ed15bd5a (diff) |
QQmlError::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: I91918090fd4e0aa9a25dbbb18893a0ce94140e21
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests/auto/quick/qquickimageprovider')
-rw-r--r-- | tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp b/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp index 48af48b17b..be302241da 100644 --- a/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp +++ b/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp @@ -206,11 +206,11 @@ void tst_qquickimageprovider::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: Invalid image provider: image://bogus/exists.png"; + << "<Unknown File>:2:1: QML Image: Invalid image provider: image://bogus/exists.png"; } void tst_qquickimageprovider::runTest(bool async, QQuickImageProvider *provider) @@ -364,7 +364,7 @@ void tst_qquickimageprovider::removeProvider() // remove the provider and confirm QString fileName = newImageFileName(); - QString error("file::2:1: QML Image: Invalid image provider: " + fileName); + QString error("<Unknown File>:2:1: QML Image: Invalid image provider: " + fileName); QTest::ignoreMessage(QtWarningMsg, error.toUtf8()); engine.removeImageProvider("test"); |