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:
Thomas Hartmann
2013-05-15 11:11:32 +02:00
parent 3604bdbad2
commit 7d25b90908
3 changed files with 24 additions and 9 deletions

View File

@@ -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 {