From aad255f6d5e79f496e93c9e758504a1d2c8a2467 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 11 Jul 2014 16:15:01 +0200 Subject: QQmlError::toString: improve handling of empty urls. "file::2:23: ..." is strange to read. Show ":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 --- .../quick/qquickpositioners/tst_qquickpositioners.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/auto/quick/qquickpositioners') diff --git a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp index e63ff6639e..035735914a 100644 --- a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp +++ b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp @@ -1857,7 +1857,7 @@ void tst_qquickpositioners::test_conflictinganchors() item = qobject_cast(component.create()); QVERIFY(item); QCOMPARE(messageHandler.messages().size(), 1); - QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function.")); + QCOMPARE(messageHandler.messages().back(), QString(":2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function.")); messageHandler.clear(); delete item; @@ -1865,7 +1865,7 @@ void tst_qquickpositioners::test_conflictinganchors() item = qobject_cast(component.create()); QVERIFY(item); QCOMPARE(messageHandler.messages().size(), 1); - QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function.")); + QCOMPARE(messageHandler.messages().back(), QString(":2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function.")); messageHandler.clear(); delete item; @@ -1879,7 +1879,7 @@ void tst_qquickpositioners::test_conflictinganchors() item = qobject_cast(component.create()); QVERIFY(item); QCOMPARE(messageHandler.messages().size(), 1); - QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row. Row will not function.")); + QCOMPARE(messageHandler.messages().back(), QString(":2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row. Row will not function.")); messageHandler.clear(); delete item; @@ -1887,7 +1887,7 @@ void tst_qquickpositioners::test_conflictinganchors() item = qobject_cast(component.create()); QVERIFY(item); QCOMPARE(messageHandler.messages().size(), 1); - QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row. Row will not function.")); + QCOMPARE(messageHandler.messages().back(), QString(":2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row. Row will not function.")); messageHandler.clear(); delete item; @@ -1901,7 +1901,7 @@ void tst_qquickpositioners::test_conflictinganchors() item = qobject_cast(component.create()); QVERIFY(item); QCOMPARE(messageHandler.messages().size(), 1); - QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Grid: Cannot specify anchors for items inside Grid. Grid will not function.")); + QCOMPARE(messageHandler.messages().back(), QString(":2:1: QML Grid: Cannot specify anchors for items inside Grid. Grid will not function.")); messageHandler.clear(); delete item; @@ -1909,7 +1909,7 @@ void tst_qquickpositioners::test_conflictinganchors() item = qobject_cast(component.create()); QVERIFY(item); QCOMPARE(messageHandler.messages().size(), 1); - QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Grid: Cannot specify anchors for items inside Grid. Grid will not function.")); + QCOMPARE(messageHandler.messages().back(), QString(":2:1: QML Grid: Cannot specify anchors for items inside Grid. Grid will not function.")); messageHandler.clear(); delete item; @@ -1917,7 +1917,7 @@ void tst_qquickpositioners::test_conflictinganchors() item = qobject_cast(component.create()); QVERIFY(item); QCOMPARE(messageHandler.messages().size(), 1); - QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Flow: Cannot specify anchors for items inside Flow. Flow will not function.")); + QCOMPARE(messageHandler.messages().back(), QString(":2:1: QML Flow: Cannot specify anchors for items inside Flow. Flow will not function.")); messageHandler.clear(); delete item; @@ -1925,7 +1925,7 @@ void tst_qquickpositioners::test_conflictinganchors() item = qobject_cast(component.create()); QVERIFY(item); QCOMPARE(messageHandler.messages().size(), 1); - QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Flow: Cannot specify anchors for items inside Flow. Flow will not function.")); + QCOMPARE(messageHandler.messages().back(), QString(":2:1: QML Flow: Cannot specify anchors for items inside Flow. Flow will not function.")); delete item; } -- cgit v1.2.3