CppEditor: FilePathify some of the refactoring operations

... and adjust surrounding code.

Change-Id: I1d36e5a0c6ba14a1d9b8fd59340f1bb2a1e45ad1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2022-11-24 17:00:52 +01:00
parent edd0e97ce1
commit e42d24fca9
18 changed files with 221 additions and 233 deletions

View File

@@ -1726,17 +1726,17 @@ void CppModelManager::onAboutToLoadSession()
GC();
}
QSet<QString> CppModelManager::dependingInternalTargets(const Utils::FilePath &file) const
QSet<QString> CppModelManager::dependingInternalTargets(const FilePath &file) const
{
QSet<QString> result;
const Snapshot snapshot = this->snapshot();
QTC_ASSERT(snapshot.contains(file), return result);
bool wasHeader;
const QString correspondingFile
= correspondingHeaderOrSource(file.toString(), &wasHeader, CacheUsage::ReadOnly);
const Utils::FilePaths dependingFiles = snapshot.filesDependingOn(
wasHeader ? file : Utils::FilePath::fromString(correspondingFile));
for (const Utils::FilePath &fn : std::as_const(dependingFiles)) {
const FilePath correspondingFile
= correspondingHeaderOrSource(file, &wasHeader, CacheUsage::ReadOnly);
const FilePaths dependingFiles = snapshot.filesDependingOn(
wasHeader ? file : correspondingFile);
for (const FilePath &fn : std::as_const(dependingFiles)) {
for (const ProjectPart::ConstPtr &part : projectPart(fn))
result.insert(part->buildSystemTarget);
}