summaryrefslogtreecommitdiff
path: root/src/plugins/qmljseditor/qmljsmodelmanager.cpp
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2010-08-25 14:15:57 +0200
committerChristian Kamm <christian.d.kamm@nokia.com>2010-08-25 14:19:44 +0200
commit36e8b65d59bfafc9951279ce175241fc23afbee2 (patch)
treebd0c3d539e8d3ae0dd719b29a6eadfe3c4c32051 /src/plugins/qmljseditor/qmljsmodelmanager.cpp
parent6cf563bb25b3bc8f48cd45e22d648bfdb16bca99 (diff)
downloadqt-creator-36e8b65d59bfafc9951279ce175241fc23afbee2.tar.gz
QmlJS: Fix running qmldump on plugins that require a specific uri.
The builtin QML plugins require to be imported with the full uri, i.e. import Qt.labs.particles 1.0 so setting the import path to imports/Qt/labs and doing import particles 1.0 is not supposed to work. (see QTBUG-11139) This change adjusts qmldump to take an import path *and* the import uri, so it will be able to dump the type information for these plugins. Reviewed-by: Erik Verbruggen
Diffstat (limited to 'src/plugins/qmljseditor/qmljsmodelmanager.cpp')
-rw-r--r--src/plugins/qmljseditor/qmljsmodelmanager.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/plugins/qmljseditor/qmljsmodelmanager.cpp b/src/plugins/qmljseditor/qmljsmodelmanager.cpp
index 836ce34a15..6bbe8a0b7f 100644
--- a/src/plugins/qmljseditor/qmljsmodelmanager.cpp
+++ b/src/plugins/qmljseditor/qmljsmodelmanager.cpp
@@ -228,9 +228,6 @@ void ModelManager::onLibraryInfoUpdated(const QString &path, const LibraryInfo &
{
QMutexLocker locker(&m_mutex);
- if (!_snapshot.libraryInfo(path).isValid())
- loadQmlPluginTypes(path);
-
_snapshot.insertLibraryInfo(path, info);
}
@@ -453,8 +450,20 @@ static QStringList environmentImportPaths()
return paths;
}
-void ModelManager::loadQmlPluginTypes(const QString &pluginPath)
+void ModelManager::loadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri)
+{
+ // make sure loading is always triggered in ModelManager's thread
+ metaObject()->invokeMethod(this, "onLoadPluginTypes",
+ Q_ARG(QString, libraryPath),
+ Q_ARG(QString, importPath),
+ Q_ARG(QString, importUri));
+}
+
+void ModelManager::onLoadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri)
{
+ if (m_runningQmldumps.values().contains(libraryPath))
+ return;
+
static QString qmldumpPath;
if (qmldumpPath.isNull()) {
QDir qmldumpExecutable(QCoreApplication::applicationDirPath());
@@ -482,8 +491,11 @@ void ModelManager::loadQmlPluginTypes(const QString &pluginPath)
QProcess *process = new QProcess(this);
connect(process, SIGNAL(finished(int)), SLOT(qmlPluginTypeDumpDone(int)));
- process->start(qmldumpPath, QStringList(pluginPath));
- m_runningQmldumps.insert(process, pluginPath);
+ QStringList args;
+ args << importPath;
+ args << importUri;
+ process->start(qmldumpPath, args);
+ m_runningQmldumps.insert(process, libraryPath);
}
void ModelManager::updateImportPaths()