aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlplugindump
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2011-06-29 14:00:34 +0200
committerQt by Nokia <qt-info@nokia.com>2011-06-29 15:08:09 +0200
commit0304a878591883a850bc001643df1af9d8a763a7 (patch)
tree54dbd3f299b9fac3692b2c23d2acd820fe35f06b /tools/qmlplugindump
parente41318cbb9261e65ddc164cd1811cb911bd70153 (diff)
qmlplugindump: Fix dumping with -path on Mac.
If the current working directory was a direct parent of the qmldir path the exported modules had the path as the module URI on macs. Also changes the QtQuick export back to 1.0 to make it work with Qt 4.7.3. The version of that import statement does not actually matter as long as it's valid. Mirrors a change in Qt Creator: http://codereview.qt.nokia.com/896 (cherry picked from commit d7ab0007d4b051f3cf12f01157b8b78d2fddf7c8) Change-Id: Ib8caa8eda7f237b10e82df3afd560c118427aa8f Reviewed-on: http://codereview.qt.nokia.com/897 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Diffstat (limited to 'tools/qmlplugindump')
-rw-r--r--tools/qmlplugindump/main.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp
index 61564d4303..9d14e36751 100644
--- a/tools/qmlplugindump/main.cpp
+++ b/tools/qmlplugindump/main.cpp
@@ -268,6 +268,9 @@ public:
if (qmlTyName.startsWith(relocatableModuleUri + QLatin1Char('/'))) {
qmlTyName.remove(0, relocatableModuleUri.size() + 1);
}
+ if (qmlTyName.startsWith("./")) {
+ qmlTyName.remove(0, 2);
+ }
exports += enquote(QString("%1 %2.%3").arg(
qmlTyName,
QString::number(qmlTy->majorVersion()),
@@ -530,11 +533,16 @@ int main(int argc, char *argv[])
QDeclarativeView view;
QDeclarativeEngine *engine = view.engine();
- if (!pluginImportPath.isEmpty())
+ if (!pluginImportPath.isEmpty()) {
+ QDir cur = QDir::current();
+ cur.cd(pluginImportPath);
+ pluginImportPath = cur.absolutePath();
+ QDir::setCurrent(pluginImportPath);
engine->addImportPath(pluginImportPath);
+ }
// find all QMetaObjects reachable from the builtin module
- QByteArray importCode("import QtQuick 1.1\n");
+ QByteArray importCode("import QtQuick 1.0\n");
QSet<const QMetaObject *> defaultReachable = collectReachableMetaObjects(importCode, engine);
// this will hold the meta objects we want to dump information of