Commit 528999d5 authored by Christian Kamm's avatar Christian Kamm
Browse files

qmldump: Ensure path and environment are taken from the same Qt version.

Fixes f1fb0bdd.

Reviewed-by: Kai Koehne
parent f1fb0bdd
......@@ -131,16 +131,7 @@ void QmlProject::refresh(RefreshOptions options)
QmlJS::ModelManagerInterface::ProjectInfo pinfo(this);
pinfo.sourceFiles = files();
pinfo.importPaths = importPaths();
pinfo.qmlDumpPath = Qt4ProjectManager::QmlDumpTool::qmlDumpPath(this);
if (activeTarget()) {
if (const QmlProjectRunConfiguration *runConfig =
qobject_cast<QmlProjectRunConfiguration*>(activeTarget()->activeRunConfiguration())) {
if (runConfig->qtVersion()) {
pinfo.qmlDumpEnvironment = runConfig->qtVersion()->qmlToolsEnvironment();
}
}
}
Qt4ProjectManager::QmlDumpTool::pathAndEnvironment(this, &pinfo.qmlDumpPath, &pinfo.qmlDumpEnvironment);
m_modelManager->updateProjectInfo(pinfo);
}
......
......@@ -272,7 +272,7 @@ QStringList QmlDumpTool::installDirectories(const QString &qtInstallData)
return directories;
}
QString QmlDumpTool::qmlDumpPath(ProjectExplorer::Project *project)
void QmlDumpTool::pathAndEnvironment(ProjectExplorer::Project *project, QString *dumperPath, Utils::Environment *env)
{
QString path;
......@@ -292,7 +292,7 @@ QString QmlDumpTool::qmlDumpPath(ProjectExplorer::Project *project)
Core::ICore::instance()->progressManager()->addTask(task, taskName,
QLatin1String("Qt4ProjectManager::BuildHelpers"));
}
return path;
return;
}
if (!path.isEmpty()) {
......@@ -306,7 +306,10 @@ QString QmlDumpTool::qmlDumpPath(ProjectExplorer::Project *project)
}
}
return path;
if (!path.isEmpty() && version && dumperPath && env) {
*dumperPath = path;
*env = version->qmlToolsEnvironment();
}
}
} // namespace Qt4ProjectManager
......
......@@ -61,7 +61,7 @@ public:
// Copy the source files to a target location and return the chosen target location.
static QString copy(const QString &qtInstallData, QString *errorMessage);
static QString qmlDumpPath(ProjectExplorer::Project *project);
static void pathAndEnvironment(ProjectExplorer::Project *project, QString *path, Utils::Environment *env);
private:
static QStringList installDirectories(const QString &qtInstallData);
......
......@@ -597,10 +597,9 @@ void Qt4Project::updateQmlJSCodeModel()
const QString qtVersionImportPath = qtVersion->versionInfo().value("QT_INSTALL_IMPORTS");
if (!qtVersionImportPath.isEmpty())
projectInfo.importPaths += qtVersionImportPath;
projectInfo.qmlDumpEnvironment = qtVersion->qmlToolsEnvironment();
projectInfo.qmlDumpPath = QmlDumpTool::qmlDumpPath(this);
}
}
QmlDumpTool::pathAndEnvironment(this, &projectInfo.qmlDumpPath, &projectInfo.qmlDumpEnvironment);
projectInfo.importPaths.removeDuplicates();
modelManager->updateProjectInfo(projectInfo);
......
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