if (!importFound && importInfo.ast()) {
error(doc, locationFromRange(importInfo.ast()->firstSourceLocation(),
importInfo.ast()->lastSourceLocation()),
- tr("package not found"));
+ tr("QML module not found\n\n"
+ "Import paths:\n"
+ "%1\n\n"
+ "For qmake projects, use the QML_IMPORT_PATH variable to add import paths.\n"
+ "For qmlproject projects, use the importPaths property to add import paths.").arg(
+ d->importPaths.join(QLatin1String("\n"))));
}
return import;
}
if (errorLoc.isValid()) {
warning(doc, errorLoc,
- tr("Library contains C++ plugins, type dump is in progress."));
+ tr("QML module contains C++ plugins, currently reading type information..."));
}
} else if (libraryInfo.pluginTypeInfoStatus() == LibraryInfo::DumpError
|| libraryInfo.pluginTypeInfoStatus() == LibraryInfo::TypeInfoFileError) {
}
}
+static QString qmldumpErrorPreamble()
+{
+ return PluginDumper::tr("QML module does not contain information about components contained in plugins.\n"
+ "See \"Using QML Modules with Plugins\" in the documentation.") + QLatin1String("\n\n");
+}
+
static QString qmldumpErrorMessage(const QString &libraryPath, const QString &error)
{
- return PluginDumper::tr("Type dump of QML plugin in %1 failed.\nErrors:\n%2\n").
- arg(libraryPath, error);
+ return qmldumpErrorPreamble() +
+ PluginDumper::tr("Automatic type dump of QML module in %1 failed.\nErrors:\n%2\n").
+ arg(libraryPath, error);
}
-static QString qmldumpFailedMessage(const QString &error)
+static QString qmldumpFailedMessage(const QString &libraryPath, const QString &error)
{
QString firstLines =
QStringList(error.split(QLatin1Char('\n')).mid(0, 10)).join(QLatin1String("\n"));
- return PluginDumper::tr("Type dump of C++ plugin failed.\n"
- "First 10 lines or errors:\n"
- "\n"
- "%1"
- "\n"
- "Check 'General Messages' output pane for details."
- ).arg(firstLines);
+ return qmldumpErrorPreamble() +
+ PluginDumper::tr("Automatic type dump of QML module in %1 failed.\n"
+ "First 10 lines or errors:\n"
+ "\n"
+ "%2"
+ "\n"
+ "Check 'General Messages' output pane for details."
+ ).arg(libraryPath, firstLines);
}
static void printParseWarnings(const QString &libraryPath, const QString &warning)
Core::MessageManager *messageManager = Core::MessageManager::instance();
const QString errorMessages = process->readAllStandardError();
messageManager->printToOutputPane(qmldumpErrorMessage(libraryPath, errorMessages));
- libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError, qmldumpFailedMessage(errorMessages));
+ libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError, qmldumpFailedMessage(libraryPath, errorMessages));
}
const QByteArray output = process->readAllStandardOutput();
QList<FakeMetaObject::ConstPtr> objectsList = parseHelper(output, &error, &warning);
if (exitCode == 0) {
if (!error.isEmpty()) {
- libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError, tr("Type dump of C++ plugin failed. Parse error:\n'%1'").arg(error));
+ libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError,
+ qmldumpErrorMessage(libraryPath, error));
} else {
libraryInfo.setMetaObjects(objectsList);
libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpDone);
if (!libraryPath.isEmpty()) {
const Snapshot snapshot = m_modelManager->snapshot();
LibraryInfo libraryInfo = snapshot.libraryInfo(libraryPath);
- libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError, qmldumpFailedMessage(errorMessages));
+ libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError, qmldumpFailedMessage(libraryPath, errorMessages));
m_modelManager->updateLibraryInfo(libraryPath, libraryInfo);
}
}
return;
libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError,
- tr("Could not locate the helper application for dumping type information from C++ plugins.\n"
- "Please build the debugging helpers on the Qt version options page."));
+ qmldumpErrorMessage(plugin.qmldirPath,
+ tr("Could not locate the helper application for dumping type information from C++ plugins.\n"
+ "Please build the qmldump applcation on the Qt version options page.")));
m_modelManager->updateLibraryInfo(plugin.qmldirPath, libraryInfo);
return;
}