forked from qt-creator/qt-creator
Debugger: Use iterateDirectory
Change-Id: I37010d4b33ac1c555f05abe91376b9befe9fa65c Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -1603,17 +1603,20 @@ QString GdbEngine::cleanupFullName(const QString &fileName)
|
||||
return cleanFilePath;
|
||||
}
|
||||
if (m_baseNameToFullName.isEmpty()) {
|
||||
QString debugSource = sysroot + "/usr/src/debug";
|
||||
if (QFileInfo(debugSource).isDir()) {
|
||||
QDirIterator it(debugSource, QDirIterator::Subdirectories);
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
QString name = it.fileName();
|
||||
if (!name.startsWith('.')) {
|
||||
QString path = it.filePath();
|
||||
m_baseNameToFullName.insert(name, path);
|
||||
}
|
||||
}
|
||||
FilePath filePath = FilePath::fromString(sysroot + "/usr/src/debug");
|
||||
|
||||
if (filePath.isDir()) {
|
||||
filePath.iterateDirectory(
|
||||
[this](const FilePath &filePath) {
|
||||
QString name = filePath.fileName();
|
||||
if (!name.startsWith('.')) {
|
||||
QString path = filePath.path();
|
||||
m_baseNameToFullName.insert(name, path);
|
||||
}
|
||||
},
|
||||
{"*"},
|
||||
QDir::NoFilter,
|
||||
QDirIterator::Subdirectories);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user