From d6bd6cd323f91b9cb01d94c560cf8b40dafeb790 Mon Sep 17 00:00:00 2001 From: Matthew Vogt Date: Mon, 16 Jul 2012 16:31:45 +1000 Subject: [PATCH] Improved error message wording When a qmldir contains multiple definitions with the same name and version numbers, the error message should indicate that the problem is localized to that qmldir file. Change-Id: I02cd4862c9ead2fd7ed1c75d0fa6949ab3eda6f6 Reviewed-by: Robin Burchell --- src/qml/qml/qqmlimport.cpp | 4 ++-- tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index 937d2df..00ea8c5 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -917,7 +917,7 @@ bool QQmlImportsPrivate::validateQmldirVersion(const QQmlTypeLoader::QmldirConte (cit2->minorVersion == cit->minorVersion)) { // This entry clashes with a predecessor QQmlError error; - error.setDescription(QQmlImportDatabase::tr("\"%1\" version %2.%3 is already defined in module \"%4\"") + error.setDescription(QQmlImportDatabase::tr("\"%1\" version %2.%3 is defined more than once in module \"%4\"") .arg(cit->typeName).arg(cit->majorVersion).arg(cit->minorVersion).arg(uri)); errors->prepend(error); return false; @@ -941,7 +941,7 @@ bool QQmlImportsPrivate::validateQmldirVersion(const QQmlTypeLoader::QmldirConte (sit2->minorVersion == sit->minorVersion)) { // This entry clashes with a predecessor QQmlError error; - error.setDescription(QQmlImportDatabase::tr("\"%1\" version %2.%3 is already defined in module \"%4\"") + error.setDescription(QQmlImportDatabase::tr("\"%1\" version %2.%3 is defined more than once in module \"%4\"") .arg(sit->nameSpace).arg(sit->majorVersion).arg(sit->minorVersion).arg(uri)); errors->prepend(error); return false; diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index 1878156..2c9593b 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -2196,12 +2196,12 @@ void tst_qqmllanguage::importsInstalled_data() << "import com.nokia.installedtest1 1.0\n" "Test {}" << "" - << "\"Test\" version 1.0 is already defined in module \"com.nokia.installedtest1\""; + << "\"Test\" version 1.0 is defined more than once in module \"com.nokia.installedtest1\""; QTest::newRow("installed import version JS clash") << "import com.nokia.installedtest2 1.0\n" "Test {}" << "" - << "\"Test\" version 1.0 is already defined in module \"com.nokia.installedtest2\""; + << "\"Test\" version 1.0 is defined more than once in module \"com.nokia.installedtest2\""; } void tst_qqmllanguage::importsInstalled() -- 2.7.4