Debugger: Use iterateDirectory

Change-Id: I37010d4b33ac1c555f05abe91376b9befe9fa65c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Artem Sokolovskii
2021-09-16 10:43:20 +02:00
parent c2996081c3
commit b6d3e67270

View File

@@ -1603,17 +1603,20 @@ QString GdbEngine::cleanupFullName(const QString &fileName)
return cleanFilePath; return cleanFilePath;
} }
if (m_baseNameToFullName.isEmpty()) { if (m_baseNameToFullName.isEmpty()) {
QString debugSource = sysroot + "/usr/src/debug"; FilePath filePath = FilePath::fromString(sysroot + "/usr/src/debug");
if (QFileInfo(debugSource).isDir()) {
QDirIterator it(debugSource, QDirIterator::Subdirectories); if (filePath.isDir()) {
while (it.hasNext()) { filePath.iterateDirectory(
it.next(); [this](const FilePath &filePath) {
QString name = it.fileName(); QString name = filePath.fileName();
if (!name.startsWith('.')) { if (!name.startsWith('.')) {
QString path = it.filePath(); QString path = filePath.path();
m_baseNameToFullName.insert(name, path); m_baseNameToFullName.insert(name, path);
} }
} },
{"*"},
QDir::NoFilter,
QDirIterator::Subdirectories);
} }
} }