diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-10-23 14:03:13 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-10-29 11:45:32 +0000 |
commit | 58c023e7c4b03905157c1a9ed9976d6228935690 (patch) | |
tree | d4b552ae3337ee12df37b74fe7b93118da564f91 /src/plugins/qmljstools/qmljsmodelmanager.cpp | |
parent | bea3a8fa6fd53cf1e85aa30cc45d1e62464c985d (diff) |
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>
Diffstat (limited to 'src/plugins/qmljstools/qmljsmodelmanager.cpp')
-rw-r--r-- | src/plugins/qmljstools/qmljsmodelmanager.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index ef2dc86d71e..fcc73d6f775 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.cpp +++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp @@ -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); } |