aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmljstools/qmljsplugindumper.cpp
diff options
context:
space:
mode:
authorChristian Kamm <[email protected]>2011-09-21 15:54:07 +0200
committerLeandro T. C. Melo <[email protected]>2011-09-21 16:03:41 +0200
commit3a110439e930c14aeebc7671c0fbce5321f4695e (patch)
tree583098898275aa3dd81c643c02947ca275e408e1 /src/plugins/qmljstools/qmljsplugindumper.cpp
parentb9772e5c81f6f2c10e8069cd7ba078d1d7e56dfd (diff)
QmlJS: Only try qmldump on Desktop and Simulator Qt.
In particular, don't complain about a missing qmldump binary on other platforms. Change-Id: Ie2e96bcb67e609aa5aed31510b06139d2d9ce77e Reviewed-on: http://codereview.qt-project.org/5327 Reviewed-by: Qt Sanity Bot <[email protected]> Reviewed-by: Leandro T. C. Melo <[email protected]>
Diffstat (limited to 'src/plugins/qmljstools/qmljsplugindumper.cpp')
-rw-r--r--src/plugins/qmljstools/qmljsplugindumper.cpp37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/plugins/qmljstools/qmljsplugindumper.cpp b/src/plugins/qmljstools/qmljsplugindumper.cpp
index 3983033682b..8d10e930c11 100644
--- a/src/plugins/qmljstools/qmljsplugindumper.cpp
+++ b/src/plugins/qmljstools/qmljsplugindumper.cpp
@@ -220,31 +220,34 @@ void PluginDumper::dumpAllPlugins()
}
}
-static QString qmldumpErrorPreamble()
+static QString noTypeinfoError(const QString &libraryPath)
{
- 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");
+ return PluginDumper::tr("QML module at:\n"
+ "%1\n"
+ "does not contain information about components contained in plugins.\n"
+ "See \"Using QML Modules with Plugins\" in the documentation.").arg(
+ libraryPath);
}
static QString qmldumpErrorMessage(const QString &libraryPath, const QString &error)
{
- return qmldumpErrorPreamble() +
- PluginDumper::tr("Automatic type dump of QML module in %1 failed.\nErrors:\n%2\n").
- arg(libraryPath, error);
+ return noTypeinfoError(libraryPath) + QLatin1String("\n\n") +
+ PluginDumper::tr("Automatic type dump of QML module failed.\nErrors:\n%1\n").
+ arg(error);
}
static QString qmldumpFailedMessage(const QString &libraryPath, const QString &error)
{
QString firstLines =
QStringList(error.split(QLatin1Char('\n')).mid(0, 10)).join(QLatin1String("\n"));
- return qmldumpErrorPreamble() +
- PluginDumper::tr("Automatic type dump of QML module in %1 failed.\n"
+ return noTypeinfoError(libraryPath) + QLatin1String("\n\n") +
+ PluginDumper::tr("Automatic type dump of QML module failed.\n"
"First 10 lines or errors:\n"
"\n"
- "%2"
+ "%1"
"\n"
"Check 'General Messages' output pane for details."
- ).arg(libraryPath, firstLines);
+ ).arg(firstLines);
}
static void printParseWarnings(const QString &libraryPath, const QString &warning)
@@ -400,16 +403,22 @@ void PluginDumper::dump(const Plugin &plugin)
ModelManagerInterface::ProjectInfo info = m_modelManager->projectInfo(activeProject);
- if (info.qmlDumpPath.isEmpty()) {
+ if (!info.tryQmlDump || info.qmlDumpPath.isEmpty()) {
const Snapshot snapshot = m_modelManager->snapshot();
LibraryInfo libraryInfo = snapshot.libraryInfo(plugin.qmldirPath);
if (!libraryInfo.isValid())
return;
- libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError,
- qmldumpErrorMessage(plugin.qmldirPath,
+ QString errorMessage;
+ if (!info.tryQmlDump) {
+ errorMessage = noTypeinfoError(plugin.qmldirPath);
+ } else {
+ errorMessage = 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.")));
+ "Please build the qmldump applcation on the Qt version options page."));
+ }
+
+ libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError, errorMessage);
m_modelManager->updateLibraryInfo(plugin.qmldirPath, libraryInfo);
return;
}