QmlJS: Clean up qmljsmodelmanagerinterface.{h|cpp}

Avoid foreach, fix linter warnings, simplify types, apply coding style.

Change-Id: I7cec65e775ee14ce60e1e57077e917285d58c152
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2019-10-23 14:03:13 +02:00
parent bea3a8fa6f
commit 58c023e7c4
4 changed files with 261 additions and 259 deletions

View File

@@ -104,7 +104,8 @@ static void setupProjectInfoQmlBundles(ModelManagerInterface::ProjectInfo &proje
ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
Project *project) const
{
ModelManagerInterface::ProjectInfo projectInfo(project);
ModelManagerInterface::ProjectInfo projectInfo;
projectInfo.project = project;
projectInfo.qmlDumpEnvironment = Utils::Environment::systemEnvironment();
Target *activeTarget = nullptr;
if (project) {
@@ -263,13 +264,15 @@ void ModelManager::updateDefaultProjectInfo()
{
// needs to be performed in the ui thread
Project *currentProject = SessionManager::startupProject();
ProjectInfo newDefaultProjectInfo = projectInfo(currentProject,
defaultProjectInfoForProject(currentProject));
setDefaultProject(projectInfo(currentProject,newDefaultProjectInfo), currentProject);
setDefaultProject(containsProject(currentProject)
? projectInfo(currentProject)
: defaultProjectInfoForProject(currentProject),
currentProject);
}
void ModelManager::addTaskInternal(QFuture<void> result, const QString &msg, const char *taskId) const
void ModelManager::addTaskInternal(const QFuture<void> &result, const QString &msg,
const char *taskId) const
{
ProgressManager::addTask(result, msg, taskId);
}