qmldump: 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.

Change-Id: Ib702356062bd239b1ad807c2592f8a69d6fde38f
Reviewed-on: http://codereview.qt.nokia.com/896
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
(cherry picked from commit dc3e803614)
This commit is contained in:
Christian Kamm
2011-06-29 13:55:53 +02:00
committed by con
parent 37c01b399e
commit 2c40acbec9

View File

@@ -266,6 +266,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