diff options
Diffstat (limited to 'src/plugins/cpptools/cpptoolsplugin.cpp')
-rw-r--r-- | src/plugins/cpptools/cpptoolsplugin.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index 58227e27b2..f2c8e455c4 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -429,19 +429,20 @@ QString correspondingHeaderOrSource(const QString &fileName, bool *wasHeader) currentProject); if (!path.isEmpty()) return path; - } // Find files in other projects - CppModelManager *modelManager = CppModelManager::instance(); - QList<CppModelManagerInterface::ProjectInfo> projectInfos = modelManager->projectInfos(); - foreach (const CppModelManagerInterface::ProjectInfo &projectInfo, projectInfos) { - const ProjectExplorer::Project *project = projectInfo.project().data(); - if (project == currentProject) - continue; // We have already checked the current project. - - const QString path = correspondingHeaderOrSourceInProject(fi, candidateFileNames, project); - if (!path.isEmpty()) - return path; + } else { + CppModelManager *modelManager = CppModelManager::instance(); + QList<CppModelManagerInterface::ProjectInfo> projectInfos = modelManager->projectInfos(); + foreach (const CppModelManagerInterface::ProjectInfo &projectInfo, projectInfos) { + const ProjectExplorer::Project *project = projectInfo.project().data(); + if (project == currentProject) + continue; // We have already checked the current project. + + const QString path = correspondingHeaderOrSourceInProject(fi, candidateFileNames, project); + if (!path.isEmpty()) + return path; + } } return QString(); |