From 0304a878591883a850bc001643df1af9d8a763a7 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Wed, 29 Jun 2011 14:00:34 +0200 Subject: [PATCH] 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 --- tools/qmlplugindump/main.cpp | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index 61564d4..9d14e36 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 defaultReachable = collectReachableMetaObjects(importCode, engine); // this will hold the meta objects we want to dump information of -- 1.7.2.5