Commit c935fd36 authored by Christian Kamm's avatar Christian Kamm
Browse files

qmldump: Use the new qmldump correctly.

parent 2ec429e8
......@@ -291,7 +291,8 @@ ObjectValue *Link::importNonFile(Document::Ptr doc, const ImportInfo &importInfo
if (libraryInfo.dumpStatus() == LibraryInfo::DumpNotStartedOrRunning) {
ModelManagerInterface *modelManager = ModelManagerInterface::instance();
if (modelManager)
modelManager->loadPluginTypes(libraryPath, importPath, packageName);
modelManager->loadPluginTypes(libraryPath, importPath,
packageName, version.toString());
warning(doc, locationFromRange(importInfo.ast()->firstSourceLocation(),
importInfo.ast()->lastSourceLocation()),
tr("Library contains C++ plugins, type dump is in progress."));
......
......@@ -131,7 +131,8 @@ public:
virtual QStringList importPaths() const = 0;
virtual void loadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri) = 0;
virtual void loadPluginTypes(const QString &libraryPath, const QString &importPath,
const QString &importUri, const QString &importVersion) = 0;
virtual CppQmlTypeHash cppQmlTypes() const = 0;
......
......@@ -571,9 +571,10 @@ void ModelManager::updateImportPaths()
updateSourceFiles(importedFiles, true);
}
void ModelManager::loadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri)
void ModelManager::loadPluginTypes(const QString &libraryPath, const QString &importPath,
const QString &importUri, const QString &importVersion)
{
m_pluginDumper->loadPluginTypes(libraryPath, importPath, importUri);
m_pluginDumper->loadPluginTypes(libraryPath, importPath, importUri, importVersion);
}
void ModelManager::queueCppQmlTypeUpdate(const CPlusPlus::Document::Ptr &doc)
......
......@@ -83,7 +83,8 @@ public:
virtual QStringList importPaths() const;
virtual void loadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri);
virtual void loadPluginTypes(const QString &libraryPath, const QString &importPath,
const QString &importUri, const QString &importVersion);
virtual CppQmlTypeHash cppQmlTypes() const;
......
......@@ -55,16 +55,17 @@ PluginDumper::PluginDumper(ModelManager *modelManager)
connect(m_pluginWatcher, SIGNAL(fileChanged(QString)), SLOT(pluginChanged(QString)));
}
void PluginDumper::loadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri)
void PluginDumper::loadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri, const QString &importVersion)
{
// move to the owning thread
metaObject()->invokeMethod(this, "onLoadPluginTypes",
Q_ARG(QString, libraryPath),
Q_ARG(QString, importPath),
Q_ARG(QString, importUri));
Q_ARG(QString, importUri),
Q_ARG(QString, importVersion));
}
void PluginDumper::onLoadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri)
void PluginDumper::onLoadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri, const QString &importVersion)
{
const QString canonicalLibraryPath = QDir::cleanPath(libraryPath);
if (m_runningQmldumps.values().contains(canonicalLibraryPath))
......@@ -87,6 +88,7 @@ void PluginDumper::onLoadPluginTypes(const QString &libraryPath, const QString &
plugin.qmldirPath = canonicalLibraryPath;
plugin.importPath = importPath;
plugin.importUri = importUri;
plugin.importVersion = importVersion;
// watch plugin libraries
foreach (const QmlDirParser::Plugin &plugin, snapshot.libraryInfo(canonicalLibraryPath).plugins()) {
......@@ -277,8 +279,10 @@ void PluginDumper::dump(const Plugin &plugin)
connect(process, SIGNAL(finished(int)), SLOT(qmlPluginTypeDumpDone(int)));
connect(process, SIGNAL(error(QProcess::ProcessError)), SLOT(qmlPluginTypeDumpError(QProcess::ProcessError)));
QStringList args;
args << plugin.importPath;
args << QLatin1String("--notrelocatable"); // ### temporary until relocatable libraries work
args << plugin.importUri;
args << plugin.importVersion;
args << plugin.importPath;
process->start(info.qmlDumpPath, args);
m_runningQmldumps.insert(process, plugin.qmldirPath);
}
......
......@@ -59,12 +59,12 @@ public:
public:
void loadPluginTypes(const QString &libraryPath, const QString &importPath,
const QString &importUri);
const QString &importUri, const QString &importVersion);
void scheduleCompleteRedump();
private slots:
void onLoadPluginTypes(const QString &libraryPath, const QString &importPath,
const QString &importUri);
const QString &importUri, const QString &importVersion);
void dumpAllPlugins();
void qmlPluginTypeDumpDone(int exitCode);
void qmlPluginTypeDumpError(QProcess::ProcessError error);
......@@ -76,6 +76,7 @@ private:
QString qmldirPath;
QString importPath;
QString importUri;
QString importVersion;
bool hasPredumpedQmlTypesFile() const;
QString predumpedQmlTypesFilePath() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment