forked from qt-creator/qt-creator
CppTools: Fix Switch Header/Source going to wrong file
Check only other projects if the current file is not part of any project. Task-number: QTCREATORBUG-12328 Change-Id: I7db65b26313a26773bbbf17e966abd668ea9a1a5 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -411,9 +411,9 @@ QString correspondingHeaderOrSource(const QString &fileName, bool *wasHeader)
|
||||
currentProject);
|
||||
if (!path.isEmpty())
|
||||
return path;
|
||||
}
|
||||
|
||||
// Find files in other projects
|
||||
} else {
|
||||
CppModelManager *modelManager = CppModelManager::instance();
|
||||
QList<CppModelManagerInterface::ProjectInfo> projectInfos = modelManager->projectInfos();
|
||||
foreach (const CppModelManagerInterface::ProjectInfo &projectInfo, projectInfos) {
|
||||
@@ -425,6 +425,7 @@ QString correspondingHeaderOrSource(const QString &fileName, bool *wasHeader)
|
||||
if (!path.isEmpty())
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user