SessionManager: Clean up methods around projects

Clean up methods around projects() and update its usages to modern
language standards.

Change-Id: Ia0a4574d014ce41e0d511a392e4eed4680981d0e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tim Jenssen
2017-03-01 17:53:15 +01:00
committed by Tobias Hunger
parent 0a09ba7319
commit f2b8e9acd1
18 changed files with 54 additions and 52 deletions

View File

@@ -195,7 +195,7 @@ bool MemcheckErrorFilterProxyModel::filterAcceptsRow(int sourceRow, const QModel
// ALGORITHM: look at last five stack frames, if none of these is inside any open projects,
// assume this error was created by an external library
QSet<QString> validFolders;
foreach (Project *project, SessionManager::projects()) {
for (Project *project : SessionManager::projects()) {
validFolders << project->projectDirectory().toString();
foreach (Target *target, project->targets()) {
foreach (const DeployableFile &file,

View File

@@ -209,7 +209,7 @@ void SuppressionDialog::accept()
// Add file to project if there is a project containing this file on the file system.
if (!ProjectExplorer::SessionManager::projectForFile(Utils::FileName::fromString(path))) {
foreach (ProjectExplorer::Project *p, ProjectExplorer::SessionManager::projects()) {
for (ProjectExplorer::Project *p : ProjectExplorer::SessionManager::projects()) {
if (path.startsWith(p->projectDirectory().toString())) {
p->rootProjectNode()->addFiles(QStringList() << path);
break;