forked from qt-creator/qt-creator
TypeDescriptionReader: Check for files that are not UTF8 encoded
We had a qmltypes file that was encoded in UTF16 and did not work. We should at least warn about it. Change-Id: I42555782ee16ddd25552f919845aa85ff1f3f636 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
@@ -326,7 +326,8 @@ void PluginDumper::qmlPluginTypeDumpDone(int exitCode)
|
||||
QString warning;
|
||||
CppQmlTypesLoader::BuiltinObjects objectsList;
|
||||
QList<ModuleApiInfo> moduleApis;
|
||||
CppQmlTypesLoader::parseQmlTypeDescriptions(output, &objectsList, &moduleApis, &error, &warning);
|
||||
CppQmlTypesLoader::parseQmlTypeDescriptions(output, &objectsList, &moduleApis, &error, &warning,
|
||||
QLatin1String("<dump of ") + libraryPath + QLatin1String(">"));
|
||||
if (exitCode == 0) {
|
||||
if (!error.isEmpty()) {
|
||||
libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError,
|
||||
@@ -397,7 +398,7 @@ void PluginDumper::loadQmltypesFile(const QStringList &qmltypesFilePaths,
|
||||
QString warning;
|
||||
CppQmlTypesLoader::BuiltinObjects newObjects;
|
||||
QList<ModuleApiInfo> newModuleApis;
|
||||
CppQmlTypesLoader::parseQmlTypeDescriptions(reader.data(), &newObjects, &newModuleApis, &error, &warning);
|
||||
CppQmlTypesLoader::parseQmlTypeDescriptions(reader.data(), &newObjects, &newModuleApis, &error, &warning, qmltypesFilePath);
|
||||
if (!error.isEmpty()) {
|
||||
errors += tr("Failed to parse '%1'.\nError: %2").arg(qmltypesFilePath, error);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user