diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2011-05-30 07:14:38 (GMT) |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2011-05-30 08:15:19 (GMT) |
commit | 49a94f19b6a4407df42b8462e52922bec42de1ba (patch) | |
tree | 8e5e1ee266feb271bb15cc924a52443d05ba322d /tools | |
parent | b9d5cb9334e7d9da71af169802a01f8d344151a7 (diff) | |
download | Qt-49a94f19b6a4407df42b8462e52922bec42de1ba.zip Qt-49a94f19b6a4407df42b8462e52922bec42de1ba.tar.gz Qt-49a94f19b6a4407df42b8462e52922bec42de1ba.tar.bz2 |
qmlplugindump: Fix --path usage with drive letters on Windows.
Since we can't import by such a path, we instead use a "." import
and set the uri of the component to the correct path.
Mirrors a change to qmldump in
qt-creator/0c8b4e38fab1862e3427aac7e7db68623bc7f174
Reviewed-by: Thomas Hartmann
(cherry picked from commit 3904e604f453b43b2a0e45a882283e26a27eaa18)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmlplugindump/main.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index 5667c7a..03bc313 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -65,6 +65,8 @@ #include <signal.h> #endif +QString pluginImportPath; + void collectReachableMetaObjects(const QMetaObject *meta, QSet<const QMetaObject *> *metas) { if (! meta || metas->contains(meta)) @@ -194,7 +196,7 @@ QSet<const QMetaObject *> collectReachableMetaObjects(const QString &importCode, code += " {}\n"; QDeclarativeComponent c(engine); - c.setData(code, QUrl("typeinstance")); + c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/typeinstance.qml")); QObject *object = c.create(); if (object) @@ -451,7 +453,6 @@ int main(int argc, char *argv[]) QString pluginImportUri; QString pluginImportVersion; - QString pluginImportPath; bool relocatable = true; bool pathImport = false; if (args.size() >= 3) { @@ -488,7 +489,7 @@ int main(int argc, char *argv[]) qWarning() << "Incorrect number of positional arguments"; return EXIT_INVALIDARGUMENTS; } - pluginImportPath = positionalArgs[1]; + pluginImportPath = QDir::fromNativeSeparators(positionalArgs[1]); if (positionalArgs.size() == 3) pluginImportVersion = positionalArgs[2]; } @@ -514,7 +515,7 @@ int main(int argc, char *argv[]) importCode += QString("import %0 %1\n").arg(pluginImportUri, pluginImportVersion).toAscii(); } else { // pluginImportVersion can be empty - importCode += QString("import \"%1\" %2\n").arg(pluginImportPath, pluginImportVersion).toAscii(); + importCode += QString("import \".\" %2\n").arg(pluginImportVersion).toAscii(); } // create a component with these imports to make sure the imports are valid @@ -524,7 +525,7 @@ int main(int argc, char *argv[]) code += "QtObject {}"; QDeclarativeComponent c(engine); - c.setData(code, QUrl("typelist")); + c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/typelist.qml")); c.create(); if (!c.errors().isEmpty()) { foreach (const QDeclarativeError &error, c.errors()) |