From d7ab0007d4b051f3cf12f01157b8b78d2fddf7c8 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Wed, 29 Jun 2011 14:00:34 +0200 Subject: 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 Reviewed-by: Kai Koehne --- tools/qmlplugindump/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index af291ee..ae06d02 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -272,6 +272,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()), @@ -536,11 +539,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 defaultReachable = collectReachableMetaObjects(importCode, engine); // this will hold the meta objects we want to dump information of -- cgit v0.12