diff options
author | Aleix Pol <aleixpol@kde.org> | 2015-06-10 21:18:15 +0200 |
---|---|---|
committer | Aleix Pol Gonzalez <aleixpol@kde.org> | 2015-06-10 19:44:05 +0000 |
commit | 9c61523069d82f016c4cf927e69aea2722c3b80b (patch) | |
tree | 40d5f26ca93eab656642b0edcd8ab50ab5e92cb6 | |
parent | e515fec1025ada6594c564fd5a90743abbc86edd (diff) |
Improve qml error message "invalid alias location"
Specify we're talking about the target itself rather than talking
location, which I always doubt about whether it's the location within the
file.
Also specify the offending property, so we get a clue about what to look
into.
[ChangeLog][QtQml] Improve "invalid alias location" error message by specifying
what's the offending property and by calling it "invalid alias target location"
Change-Id: I7a9390089ee8986872c119df44d8036bf267ab99
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
6 files changed, 8 insertions, 8 deletions
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp index 21846775a3..46b67d5983 100644 --- a/src/qml/compiler/qqmltypecompiler.cpp +++ b/src/qml/compiler/qqmltypecompiler.cpp @@ -1622,7 +1622,7 @@ bool QQmlComponentAndAliasResolver::resolveAliases() QQmlPropertyData *targetProperty = resolver.property(property.toString()); if (!targetProperty || targetProperty->coreIndex > 0x0000FFFF) { - recordError(p->aliasLocation, tr("Invalid alias location")); + recordError(p->aliasLocation, tr("Invalid alias target location: %1").arg(property.toString())); return false; } @@ -1636,7 +1636,7 @@ bool QQmlComponentAndAliasResolver::resolveAliases() if (!subProperty.isEmpty()) { const QMetaObject *valueTypeMetaObject = QQmlValueTypeFactory::metaObjectForMetaType(type); if (!valueTypeMetaObject) { - recordError(p->aliasLocation, tr("Invalid alias location")); + recordError(p->aliasLocation, tr("Invalid alias target location: %1").arg(subProperty.toString())); return false; } @@ -1645,7 +1645,7 @@ bool QQmlComponentAndAliasResolver::resolveAliases() int valueTypeIndex = valueTypeMetaObject->indexOfProperty(subProperty.toString().toUtf8().constData()); if (valueTypeIndex == -1) { - recordError(p->aliasLocation, tr("Invalid alias location")); + recordError(p->aliasLocation, tr("Invalid alias target location: %1").arg(subProperty.toString())); return false; } Q_ASSERT(valueTypeIndex <= 0x0000FFFF); diff --git a/tests/auto/qml/qqmllanguage/data/invalidAlias.10.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidAlias.10.errors.txt index 93652a7042..1ac78f2fc2 100644 --- a/tests/auto/qml/qqmllanguage/data/invalidAlias.10.errors.txt +++ b/tests/auto/qml/qqmllanguage/data/invalidAlias.10.errors.txt @@ -1 +1 @@ -5:23:Invalid alias location +5:23:Invalid alias target location: blah diff --git a/tests/auto/qml/qqmllanguage/data/invalidAlias.6.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidAlias.6.errors.txt index 93652a7042..5b467ebc31 100644 --- a/tests/auto/qml/qqmllanguage/data/invalidAlias.6.errors.txt +++ b/tests/auto/qml/qqmllanguage/data/invalidAlias.6.errors.txt @@ -1 +1 @@ -5:23:Invalid alias location +5:23:Invalid alias target location: foobar diff --git a/tests/auto/qml/qqmllanguage/data/invalidAlias.7.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidAlias.7.errors.txt index 93652a7042..8334f30ede 100644 --- a/tests/auto/qml/qqmllanguage/data/invalidAlias.7.errors.txt +++ b/tests/auto/qml/qqmllanguage/data/invalidAlias.7.errors.txt @@ -1 +1 @@ -5:23:Invalid alias location +5:23:Invalid alias target location: nonScriptable diff --git a/tests/auto/qml/qqmllanguage/data/invalidAlias.8.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidAlias.8.errors.txt index 93652a7042..c77182f3ba 100644 --- a/tests/auto/qml/qqmllanguage/data/invalidAlias.8.errors.txt +++ b/tests/auto/qml/qqmllanguage/data/invalidAlias.8.errors.txt @@ -1 +1 @@ -5:23:Invalid alias location +5:23:Invalid alias target location: imaginary diff --git a/tests/auto/qml/qqmllanguage/data/invalidAlias.9.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidAlias.9.errors.txt index 93652a7042..33ba4d293e 100644 --- a/tests/auto/qml/qqmllanguage/data/invalidAlias.9.errors.txt +++ b/tests/auto/qml/qqmllanguage/data/invalidAlias.9.errors.txt @@ -1 +1 @@ -5:23:Invalid alias location +5:23:Invalid alias target location: x |