Commit fbaa9d83 authored by Fawzi Mohamed's avatar Fawzi Mohamed Committed by Fawzi Mohamed

qmljs:reduce warnings for private plugins

Private plugin are considered those whose name ends with "private".
Avoid being misleading, i.e. do not declare the plugin dump as successful.

Change-Id: Id181d3a09dc9c4895f6566e22ad670435bd5a7f8
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@theqtcompany.com>
parent 27d5e309
......@@ -487,8 +487,10 @@ bool LinkPrivate::importLibrary(Document::Ptr doc,
} else if (libraryInfo.pluginTypeInfoStatus() == LibraryInfo::DumpError
|| libraryInfo.pluginTypeInfoStatus() == LibraryInfo::TypeInfoFileError) {
// Only underline import if package isn't described in .qmltypes anyway
// and is not a private package
QString packageName = importInfo.name();
if (errorLoc.isValid() && (packageName.isEmpty() || !valueOwner->cppQmlTypes().hasModule(packageName))) {
if (errorLoc.isValid() && (packageName.isEmpty() || !valueOwner->cppQmlTypes().hasModule(packageName))
&& !packageName.endsWith(QLatin1String("private"), Qt::CaseInsensitive)) {
error(doc, errorLoc, libraryInfo.pluginTypeInfoError());
import->valid = false;
}
......
......@@ -307,10 +307,12 @@ void PluginDumper::qmlPluginTypeDumpDone(int exitCode)
return;
const Snapshot snapshot = m_modelManager->snapshot();
LibraryInfo libraryInfo = snapshot.libraryInfo(libraryPath);
bool privatePlugin = libraryPath.endsWith(QLatin1String("private"));
if (exitCode != 0) {
const QString errorMessages = qmlPluginDumpErrorMessage(process);
ModelManagerInterface::writeWarning(qmldumpErrorMessage(libraryPath, errorMessages));
if (!privatePlugin)
ModelManagerInterface::writeWarning(qmldumpErrorMessage(libraryPath, errorMessages));
libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError, qmldumpFailedMessage(libraryPath, errorMessages));
}
......@@ -325,7 +327,8 @@ void PluginDumper::qmlPluginTypeDumpDone(int exitCode)
if (!error.isEmpty()) {
libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError,
qmldumpErrorMessage(libraryPath, error));
printParseWarnings(libraryPath, libraryInfo.pluginTypeInfoError());
if (!privatePlugin)
printParseWarnings(libraryPath, libraryInfo.pluginTypeInfoError());
} else {
libraryInfo.setMetaObjects(objectsList.values());
libraryInfo.setModuleApis(moduleApis);
......@@ -350,16 +353,14 @@ void PluginDumper::qmlPluginTypeDumpError(QProcess::ProcessError)
const QString libraryPath = m_runningQmldumps.take(process);
if (libraryPath.isEmpty())
return;
const QString errorMessages = qmlPluginDumpErrorMessage(process);
ModelManagerInterface::writeWarning(qmldumpErrorMessage(libraryPath, errorMessages));
if (!libraryPath.isEmpty()) {
const Snapshot snapshot = m_modelManager->snapshot();
LibraryInfo libraryInfo = snapshot.libraryInfo(libraryPath);
libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError, qmldumpFailedMessage(libraryPath, errorMessages));
libraryInfo.updateFingerprint();
m_modelManager->updateLibraryInfo(libraryPath, libraryInfo);
}
const Snapshot snapshot = m_modelManager->snapshot();
LibraryInfo libraryInfo = snapshot.libraryInfo(libraryPath);
if (!libraryPath.endsWith(QLatin1String("private"), Qt::CaseInsensitive))
ModelManagerInterface::writeWarning(qmldumpErrorMessage(libraryPath, errorMessages));
libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError, qmldumpFailedMessage(libraryPath, errorMessages));
libraryInfo.updateFingerprint();
m_modelManager->updateLibraryInfo(libraryPath, libraryInfo);
}
void PluginDumper::pluginChanged(const QString &pluginLibrary)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment