Debugger: Remove foreach / Q_FOREACH usage

Task-number: QTCREATORBUG-27464
Change-Id: Ib49afb4d0283aeeffead6b31e1a3d0bcb9a7ae14
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Artem Sokolovskii
2022-04-29 12:43:37 +02:00
parent fbefd45b94
commit 27fddc8dc7
10 changed files with 54 additions and 40 deletions

View File

@@ -1611,7 +1611,8 @@ void DebuggerEnginePrivate::cleanupViews()
const bool closeMemory = debuggerSettings()->closeMemoryBuffersOnExit.value();
QList<IDocument *> toClose;
foreach (IDocument *document, DocumentModel::openedDocuments()) {
const QList<IDocument *> documents = DocumentModel::openedDocuments();
for (IDocument *document : documents) {
const bool isMemory = document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool();
if (document->property(Constants::OPENED_BY_DEBUGGER).toBool()) {
bool keepIt = true;
@@ -2501,8 +2502,8 @@ void DebuggerEngine::handleExecRunToSelectedFunction()
QString functionName = cursor.selectedText();
if (functionName.isEmpty()) {
const QTextBlock block = cursor.block();
const QString line = block.text();
foreach (const QString &str, line.trimmed().split('(')) {
const QStringList lineList = block.text().trimmed().split('(');
for (const QString &str : lineList) {
QString a;
for (int i = str.size(); --i >= 0; ) {
if (!str.at(i).isLetterOrNumber())