forked from qt-creator/qt-creator
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:
@@ -1611,7 +1611,8 @@ void DebuggerEnginePrivate::cleanupViews()
|
|||||||
const bool closeMemory = debuggerSettings()->closeMemoryBuffersOnExit.value();
|
const bool closeMemory = debuggerSettings()->closeMemoryBuffersOnExit.value();
|
||||||
|
|
||||||
QList<IDocument *> toClose;
|
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();
|
const bool isMemory = document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool();
|
||||||
if (document->property(Constants::OPENED_BY_DEBUGGER).toBool()) {
|
if (document->property(Constants::OPENED_BY_DEBUGGER).toBool()) {
|
||||||
bool keepIt = true;
|
bool keepIt = true;
|
||||||
@@ -2501,8 +2502,8 @@ void DebuggerEngine::handleExecRunToSelectedFunction()
|
|||||||
QString functionName = cursor.selectedText();
|
QString functionName = cursor.selectedText();
|
||||||
if (functionName.isEmpty()) {
|
if (functionName.isEmpty()) {
|
||||||
const QTextBlock block = cursor.block();
|
const QTextBlock block = cursor.block();
|
||||||
const QString line = block.text();
|
const QStringList lineList = block.text().trimmed().split('(');
|
||||||
foreach (const QString &str, line.trimmed().split('(')) {
|
for (const QString &str : lineList) {
|
||||||
QString a;
|
QString a;
|
||||||
for (int i = str.size(); --i >= 0; ) {
|
for (int i = str.size(); --i >= 0; ) {
|
||||||
if (!str.at(i).isLetterOrNumber())
|
if (!str.at(i).isLetterOrNumber())
|
||||||
|
@@ -213,7 +213,7 @@ void DebuggerRunTool::setStartMode(DebuggerStartMode startMode)
|
|||||||
projects.removeOne(startupProject);
|
projects.removeOne(startupProject);
|
||||||
projects.insert(0, startupProject);
|
projects.insert(0, startupProject);
|
||||||
}
|
}
|
||||||
foreach (Project *project, projects)
|
for (Project *project : qAsConst(projects))
|
||||||
m_runParameters.projectSourceFiles.append(project->files(Project::SourceFiles));
|
m_runParameters.projectSourceFiles.append(project->files(Project::SourceFiles));
|
||||||
if (!projects.isEmpty())
|
if (!projects.isEmpty())
|
||||||
m_runParameters.projectSourceDirectory = projects.first()->projectDirectory();
|
m_runParameters.projectSourceDirectory = projects.first()->projectDirectory();
|
||||||
|
@@ -1319,7 +1319,8 @@ void DebuggerToolTipManagerPrivate::leavingDebugMode()
|
|||||||
hideAllToolTips();
|
hideAllToolTips();
|
||||||
if (QWidget *topLevel = ICore::mainWindow()->topLevelWidget())
|
if (QWidget *topLevel = ICore::mainWindow()->topLevelWidget())
|
||||||
topLevel->removeEventFilter(this);
|
topLevel->removeEventFilter(this);
|
||||||
foreach (IEditor *e, DocumentModel::editorsForOpenedDocuments()) {
|
const QList<IEditor *> editors = DocumentModel::editorsForOpenedDocuments();
|
||||||
|
for (IEditor *e : editors) {
|
||||||
if (auto toolTipEditor = qobject_cast<BaseTextEditor *>(e)) {
|
if (auto toolTipEditor = qobject_cast<BaseTextEditor *>(e)) {
|
||||||
toolTipEditor->editorWidget()->verticalScrollBar()->disconnect(this);
|
toolTipEditor->editorWidget()->verticalScrollBar()->disconnect(this);
|
||||||
toolTipEditor->editorWidget()->disconnect(this);
|
toolTipEditor->editorWidget()->disconnect(this);
|
||||||
|
@@ -265,7 +265,8 @@ void DisassemblerAgentPrivate::configureMimeType()
|
|||||||
|
|
||||||
Utils::MimeType mtype = Utils::mimeTypeForName(mimeType);
|
Utils::MimeType mtype = Utils::mimeTypeForName(mimeType);
|
||||||
if (mtype.isValid()) {
|
if (mtype.isValid()) {
|
||||||
foreach (IEditor *editor, DocumentModel::editorsForDocument(document))
|
const QList<IEditor *> editors = DocumentModel::editorsForDocument(document);
|
||||||
|
for (IEditor *editor : editors)
|
||||||
if (auto widget = TextEditorWidget::fromEditor(editor))
|
if (auto widget = TextEditorWidget::fromEditor(editor))
|
||||||
widget->configureGenericHighlighter();
|
widget->configureGenericHighlighter();
|
||||||
} else {
|
} else {
|
||||||
|
@@ -818,13 +818,13 @@ void GdbEngine::commandTimeout()
|
|||||||
QList<int> keys = m_commandForToken.keys();
|
QList<int> keys = m_commandForToken.keys();
|
||||||
Utils::sort(keys);
|
Utils::sort(keys);
|
||||||
bool killIt = false;
|
bool killIt = false;
|
||||||
foreach (int key, keys) {
|
for (int key : qAsConst(keys)) {
|
||||||
const DebuggerCommand &cmd = m_commandForToken.value(key);
|
const DebuggerCommand &cmd = m_commandForToken.value(key);
|
||||||
killIt = true;
|
killIt = true;
|
||||||
showMessage(QString::number(key) + ": " + cmd.function);
|
showMessage(QString::number(key) + ": " + cmd.function);
|
||||||
}
|
}
|
||||||
QStringList commands;
|
QStringList commands;
|
||||||
foreach (const DebuggerCommand &cmd, m_commandForToken)
|
for (const DebuggerCommand &cmd : qAsConst(m_commandForToken))
|
||||||
commands << QString("\"%1\"").arg(cmd.function);
|
commands << QString("\"%1\"").arg(cmd.function);
|
||||||
if (killIt) {
|
if (killIt) {
|
||||||
showMessage(QString("TIMED OUT WAITING FOR GDB REPLY. "
|
showMessage(QString("TIMED OUT WAITING FOR GDB REPLY. "
|
||||||
@@ -2606,7 +2606,7 @@ void GdbEngine::insertBreakpoint(const Breakpoint &bp)
|
|||||||
QVariant tpCaps = bp->property(tracepointCapturePropertyName);
|
QVariant tpCaps = bp->property(tracepointCapturePropertyName);
|
||||||
if (tpCaps.isValid()) {
|
if (tpCaps.isValid()) {
|
||||||
QJsonArray caps;
|
QJsonArray caps;
|
||||||
foreach (const auto &tpCap, tpCaps.toList()) {
|
for (const QVariant &tpCap : tpCaps.toList()) {
|
||||||
TracepointCaptureData data = tpCap.value<TracepointCaptureData>();
|
TracepointCaptureData data = tpCap.value<TracepointCaptureData>();
|
||||||
QJsonArray cap;
|
QJsonArray cap;
|
||||||
cap.append(static_cast<int>(data.type));
|
cap.append(static_cast<int>(data.type));
|
||||||
@@ -2844,7 +2844,8 @@ static void handleShowModuleSymbols(const DebuggerResponse &response,
|
|||||||
// Object file /opt/dev/qt/lib/libQtNetworkMyns.so.4:
|
// Object file /opt/dev/qt/lib/libQtNetworkMyns.so.4:
|
||||||
// [ 0] A 0x16bd64 _DYNAMIC moc_qudpsocket.cpp
|
// [ 0] A 0x16bd64 _DYNAMIC moc_qudpsocket.cpp
|
||||||
// [12] S 0xe94680 _ZN4myns5QFileC1Ev section .plt myns::QFile::QFile()
|
// [12] S 0xe94680 _ZN4myns5QFileC1Ev section .plt myns::QFile::QFile()
|
||||||
foreach (const QString &line, QString::fromLocal8Bit(file.readAll()).split('\n')) {
|
const QStringList lines = QString::fromLocal8Bit(file.readAll()).split('\n');
|
||||||
|
for (const QString &line : lines) {
|
||||||
if (line.isEmpty())
|
if (line.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
if (line.at(0) != '[')
|
if (line.at(0) != '[')
|
||||||
@@ -2928,7 +2929,7 @@ void GdbEngine::handleShowModuleSections(const DebuggerResponse &response,
|
|||||||
const QString needle = prefix + moduleName;
|
const QString needle = prefix + moduleName;
|
||||||
Sections sections;
|
Sections sections;
|
||||||
bool active = false;
|
bool active = false;
|
||||||
foreach (const QString &line, lines) {
|
for (const QString &line : qAsConst(lines)) {
|
||||||
if (line.startsWith(prefix)) {
|
if (line.startsWith(prefix)) {
|
||||||
if (active)
|
if (active)
|
||||||
break;
|
break;
|
||||||
@@ -3752,7 +3753,8 @@ bool GdbEngine::handleCliDisassemblerResult(const QString &output, DisassemblerA
|
|||||||
// First line is something like
|
// First line is something like
|
||||||
// "Dump of assembler code from 0xb7ff598f to 0xb7ff5a07:"
|
// "Dump of assembler code from 0xb7ff598f to 0xb7ff5a07:"
|
||||||
DisassemblerLines dlines;
|
DisassemblerLines dlines;
|
||||||
foreach (const QString &line, output.split('\n'))
|
const QStringList lineList = output.split('\n');
|
||||||
|
for (const QString &line : lineList)
|
||||||
dlines.appendUnparsed(line);
|
dlines.appendUnparsed(line);
|
||||||
|
|
||||||
QVector<DisassemblerLine> lines = dlines.data();
|
QVector<DisassemblerLine> lines = dlines.data();
|
||||||
@@ -3829,10 +3831,10 @@ void GdbEngine::setupEngine()
|
|||||||
gdbCommand.addArg("--tty=" + m_outputCollector.serverName());
|
gdbCommand.addArg("--tty=" + m_outputCollector.serverName());
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString tests = QString::fromLocal8Bit(qgetenv("QTC_DEBUGGER_TESTS"));
|
const QStringList testList = QString::fromLocal8Bit(qgetenv("QTC_DEBUGGER_TESTS")).split(',');
|
||||||
foreach (const QString &test, tests.split(','))
|
for (const QString &test : testList)
|
||||||
m_testCases.insert(test.toInt());
|
m_testCases.insert(test.toInt());
|
||||||
foreach (int test, m_testCases)
|
for (int test : qAsConst(m_testCases))
|
||||||
showMessage("ENABLING TEST CASE: " + QString::number(test));
|
showMessage("ENABLING TEST CASE: " + QString::number(test));
|
||||||
|
|
||||||
m_expectTerminalTrap = terminal();
|
m_expectTerminalTrap = terminal();
|
||||||
@@ -4052,7 +4054,8 @@ void GdbEngine::setEnvironmentVariables()
|
|||||||
|
|
||||||
Environment sysEnv = Environment::systemEnvironment();
|
Environment sysEnv = Environment::systemEnvironment();
|
||||||
Environment runEnv = runParameters().inferior.environment;
|
Environment runEnv = runParameters().inferior.environment;
|
||||||
foreach (const EnvironmentItem &item, sysEnv.diff(runEnv)) {
|
const NameValueItems items = sysEnv.diff(runEnv);
|
||||||
|
for (const EnvironmentItem &item : items) {
|
||||||
// imitate the weird windows gdb behavior of setting the case of the path environment
|
// imitate the weird windows gdb behavior of setting the case of the path environment
|
||||||
// variable name to an all uppercase PATH
|
// variable name to an all uppercase PATH
|
||||||
const QString name = isWindowsPath(item.name) ? "PATH" : item.name;
|
const QString name = isWindowsPath(item.name) ? "PATH" : item.name;
|
||||||
@@ -4103,8 +4106,8 @@ void GdbEngine::abortDebuggerProcess()
|
|||||||
void GdbEngine::resetInferior()
|
void GdbEngine::resetInferior()
|
||||||
{
|
{
|
||||||
if (!runParameters().commandsForReset.isEmpty()) {
|
if (!runParameters().commandsForReset.isEmpty()) {
|
||||||
const QString commands = expand(runParameters().commandsForReset);
|
const QStringList commands = expand(runParameters().commandsForReset).split('\n');
|
||||||
foreach (QString command, commands.split('\n')) {
|
for (QString command : commands) {
|
||||||
command = command.trimmed();
|
command = command.trimmed();
|
||||||
if (!command.isEmpty())
|
if (!command.isEmpty())
|
||||||
runCommand({command, ConsoleCommand | NeedsTemporaryStop | NativeCommand});
|
runCommand({command, ConsoleCommand | NeedsTemporaryStop | NativeCommand});
|
||||||
@@ -4185,7 +4188,7 @@ void GdbEngine::resetCommandQueue()
|
|||||||
QString msg;
|
QString msg;
|
||||||
QTextStream ts(&msg);
|
QTextStream ts(&msg);
|
||||||
ts << "RESETING COMMAND QUEUE. LEFT OVER TOKENS: ";
|
ts << "RESETING COMMAND QUEUE. LEFT OVER TOKENS: ";
|
||||||
foreach (const DebuggerCommand &cmd, m_commandForToken)
|
for (const DebuggerCommand &cmd : qAsConst(m_commandForToken))
|
||||||
ts << "CMD:" << cmd.function;
|
ts << "CMD:" << cmd.function;
|
||||||
m_commandForToken.clear();
|
m_commandForToken.clear();
|
||||||
m_flagsForToken.clear();
|
m_flagsForToken.clear();
|
||||||
|
@@ -472,7 +472,8 @@ void QmlEngine::gotoLocation(const Location &location)
|
|||||||
|
|
||||||
QString titlePattern = tr("JS Source for %1").arg(fileName);
|
QString titlePattern = tr("JS Source for %1").arg(fileName);
|
||||||
//Check if there are open documents with the same title
|
//Check if there are open documents with the same title
|
||||||
foreach (IDocument *document, DocumentModel::openedDocuments()) {
|
const QList<IDocument *> documents = DocumentModel::openedDocuments();
|
||||||
|
for (IDocument *document: documents) {
|
||||||
if (document->displayName() == titlePattern) {
|
if (document->displayName() == titlePattern) {
|
||||||
EditorManager::activateEditorForDocument(document);
|
EditorManager::activateEditorForDocument(document);
|
||||||
return;
|
return;
|
||||||
@@ -895,7 +896,7 @@ static ConsoleItem *constructLogItemTree(const QVariant &result,
|
|||||||
std::sort(children.begin(), children.end(), compareConsoleItems);
|
std::sort(children.begin(), children.end(), compareConsoleItems);
|
||||||
|
|
||||||
item = new ConsoleItem(ConsoleItem::DefaultType, text);
|
item = new ConsoleItem(ConsoleItem::DefaultType, text);
|
||||||
foreach (ConsoleItem *child, children) {
|
for (ConsoleItem *child : qAsConst(children)) {
|
||||||
if (child)
|
if (child)
|
||||||
item->appendChild(child);
|
item->appendChild(child);
|
||||||
}
|
}
|
||||||
@@ -915,7 +916,7 @@ static ConsoleItem *constructLogItemTree(const QVariant &result,
|
|||||||
std::sort(children.begin(), children.end(), compareConsoleItems);
|
std::sort(children.begin(), children.end(), compareConsoleItems);
|
||||||
|
|
||||||
item = new ConsoleItem(ConsoleItem::DefaultType, text);
|
item = new ConsoleItem(ConsoleItem::DefaultType, text);
|
||||||
foreach (ConsoleItem *child, children) {
|
for (ConsoleItem *child : qAsConst(children)) {
|
||||||
if (child)
|
if (child)
|
||||||
item->appendChild(child);
|
item->appendChild(child);
|
||||||
}
|
}
|
||||||
@@ -1102,7 +1103,8 @@ void QmlEnginePrivate::updateScriptSource(const QString &fileName, int lineOffse
|
|||||||
//update open editors
|
//update open editors
|
||||||
QString titlePattern = QCoreApplication::translate("QmlEngine", "JS Source for %1").arg(fileName);
|
QString titlePattern = QCoreApplication::translate("QmlEngine", "JS Source for %1").arg(fileName);
|
||||||
//Check if there are open editors with the same title
|
//Check if there are open editors with the same title
|
||||||
foreach (IDocument *doc, DocumentModel::openedDocuments()) {
|
const QList<IDocument *> documents = DocumentModel::openedDocuments();
|
||||||
|
for (IDocument *doc: documents) {
|
||||||
if (doc->displayName() == titlePattern) {
|
if (doc->displayName() == titlePattern) {
|
||||||
updateDocument(doc, document);
|
updateDocument(doc, document);
|
||||||
break;
|
break;
|
||||||
@@ -1646,7 +1648,8 @@ void QmlEnginePrivate::runDirectCommand(const QString &type, const QByteArray &m
|
|||||||
void QmlEnginePrivate::memorizeRefs(const QVariant &refs)
|
void QmlEnginePrivate::memorizeRefs(const QVariant &refs)
|
||||||
{
|
{
|
||||||
if (refs.isValid()) {
|
if (refs.isValid()) {
|
||||||
foreach (const QVariant &ref, refs.toList()) {
|
const QList<QVariant> refList = refs.toList();
|
||||||
|
for (const QVariant &ref : refList) {
|
||||||
const QVariantMap refData = ref.toMap();
|
const QVariantMap refData = ref.toMap();
|
||||||
int handle = refData.value(HANDLE).toInt();
|
int handle = refData.value(HANDLE).toInt();
|
||||||
refVals[handle] = extractData(refData);
|
refVals[handle] = extractData(refData);
|
||||||
@@ -1811,7 +1814,7 @@ void QmlEnginePrivate::messageReceived(const QByteArray &data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QMap<QString,QString> files;
|
QMap<QString,QString> files;
|
||||||
foreach (const QString &file, sourceFiles) {
|
for (const QString &file : qAsConst(sourceFiles)) {
|
||||||
QString shortName = file;
|
QString shortName = file;
|
||||||
QString fullName = engine->toFileInProject(file);
|
QString fullName = engine->toFileInProject(file);
|
||||||
files.insert(shortName, fullName);
|
files.insert(shortName, fullName);
|
||||||
@@ -2238,7 +2241,7 @@ void QmlEnginePrivate::constructChildLogItems(ConsoleItem *item, const QmlV8Obje
|
|||||||
if (debuggerSettings()->sortStructMembers.value())
|
if (debuggerSettings()->sortStructMembers.value())
|
||||||
std::sort(children.begin(), children.end(), compareConsoleItems);
|
std::sort(children.begin(), children.end(), compareConsoleItems);
|
||||||
|
|
||||||
foreach (ConsoleItem *child, children)
|
for (ConsoleItem *child : qAsConst(children))
|
||||||
item->appendChild(child);
|
item->appendChild(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2364,7 +2367,7 @@ void QmlEnginePrivate::handleExecuteDebuggerCommand(const QVariantMap &response)
|
|||||||
debuggerConsole()->printItem(constructLogItemTree(extractData(response.value(BODY))));
|
debuggerConsole()->printItem(constructLogItemTree(extractData(response.value(BODY))));
|
||||||
|
|
||||||
// Update the locals
|
// Update the locals
|
||||||
foreach (int index, currentFrameScopes)
|
for (int index : qAsConst(currentFrameScopes))
|
||||||
scope(index);
|
scope(index);
|
||||||
} else {
|
} else {
|
||||||
debuggerConsole()->printItem(new ConsoleItem(ConsoleItem::ErrorType,
|
debuggerConsole()->printItem(new ConsoleItem(ConsoleItem::ErrorType,
|
||||||
@@ -2439,7 +2442,7 @@ void QmlEnginePrivate::handleVersion(const QVariantMap &response)
|
|||||||
void QmlEnginePrivate::flushSendBuffer()
|
void QmlEnginePrivate::flushSendBuffer()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state() == Enabled, return);
|
QTC_ASSERT(state() == Enabled, return);
|
||||||
foreach (const QByteArray &msg, sendBuffer)
|
for (const QByteArray &msg : qAsConst(sendBuffer))
|
||||||
sendMessage(msg);
|
sendMessage(msg);
|
||||||
sendBuffer.clear();
|
sendBuffer.clear();
|
||||||
}
|
}
|
||||||
|
@@ -237,7 +237,8 @@ void clearExceptionSelection()
|
|||||||
{
|
{
|
||||||
QList<QTextEdit::ExtraSelection> selections;
|
QList<QTextEdit::ExtraSelection> selections;
|
||||||
|
|
||||||
foreach (IEditor *editor, DocumentModel::editorsForOpenedDocuments()) {
|
const QList<IEditor *> editors = DocumentModel::editorsForOpenedDocuments();
|
||||||
|
for (IEditor *editor : editors) {
|
||||||
if (auto ed = TextEditorWidget::fromEditor(editor))
|
if (auto ed = TextEditorWidget::fromEditor(editor))
|
||||||
ed->setExtraSelections(TextEditorWidget::DebuggerExceptionSelection, selections);
|
ed->setExtraSelections(TextEditorWidget::DebuggerExceptionSelection, selections);
|
||||||
}
|
}
|
||||||
|
@@ -649,7 +649,8 @@ void QmlInspectorAgent::addWatchData(const ObjectReference &obj,
|
|||||||
propertiesWatch->value = "list";
|
propertiesWatch->value = "list";
|
||||||
propertiesWatch->wantsChildren = true;
|
propertiesWatch->wantsChildren = true;
|
||||||
|
|
||||||
foreach (const PropertyReference &property, obj.properties()) {
|
const QList<PropertyReference> properties = obj.properties();
|
||||||
|
for (const PropertyReference &property : properties) {
|
||||||
const QString propertyName = property.name();
|
const QString propertyName = property.name();
|
||||||
if (propertyName.isEmpty())
|
if (propertyName.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
@@ -669,7 +670,8 @@ void QmlInspectorAgent::addWatchData(const ObjectReference &obj,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// recurse
|
// recurse
|
||||||
foreach (const ObjectReference &child, obj.children())
|
const QList<ObjectReference> children = obj.children();
|
||||||
|
for (const ObjectReference &child : children)
|
||||||
addWatchData(child, objIname, append);
|
addWatchData(child, objIname, append);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -331,7 +331,7 @@ bool ThreadsHandler::notifyGroupExited(const QString &groupId)
|
|||||||
if (item->threadData.groupId == groupId)
|
if (item->threadData.groupId == groupId)
|
||||||
list.append(item);
|
list.append(item);
|
||||||
});
|
});
|
||||||
foreach (ThreadItem *item, list)
|
for (ThreadItem *item : qAsConst(list))
|
||||||
destroyItem(item);
|
destroyItem(item);
|
||||||
|
|
||||||
m_pidForGroupId.remove(groupId);
|
m_pidForGroupId.remove(groupId);
|
||||||
|
@@ -1172,7 +1172,8 @@ bool WatchModel::setData(const QModelIndex &idx, const QVariant &value, int role
|
|||||||
if (auto kev = ev.as<QKeyEvent>(QEvent::KeyPress)) {
|
if (auto kev = ev.as<QKeyEvent>(QEvent::KeyPress)) {
|
||||||
if (item && (kev->key() == Qt::Key_Delete || kev->key() == Qt::Key_Backspace)
|
if (item && (kev->key() == Qt::Key_Delete || kev->key() == Qt::Key_Backspace)
|
||||||
&& item->isWatcher()) {
|
&& item->isWatcher()) {
|
||||||
foreach (const QModelIndex &idx, ev.selectedRows())
|
const QModelIndexList selectedRows = ev.selectedRows();
|
||||||
|
for (const QModelIndex &idx : selectedRows)
|
||||||
removeWatchItem(itemForIndex(idx));
|
removeWatchItem(itemForIndex(idx));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1544,7 +1545,7 @@ MemoryMarkupList WatchModel::variableMemoryMarkup(WatchItem *item,
|
|||||||
name = ranges.at(i).second;
|
name = ranges.at(i).second;
|
||||||
}
|
}
|
||||||
dbg << '\n';
|
dbg << '\n';
|
||||||
foreach (const MemoryMarkup &m, result)
|
for (const MemoryMarkup &m : qAsConst(result))
|
||||||
dbg << m.address << ' ' << m.length << ' ' << m.toolTip << '\n';
|
dbg << m.address << ' ' << m.length << ' ' << m.toolTip << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2180,7 +2181,7 @@ void WatchHandler::insertItems(const GdbMi &data)
|
|||||||
itemsToSort.insert(static_cast<WatchItem *>(item->parent()));
|
itemsToSort.insert(static_cast<WatchItem *>(item->parent()));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (WatchItem *toplevel, itemsToSort)
|
for (WatchItem *toplevel : qAsConst(itemsToSort))
|
||||||
toplevel->sortChildren(&sortByName);
|
toplevel->sortChildren(&sortByName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2219,7 +2220,7 @@ bool WatchHandler::insertItem(WatchItem *item)
|
|||||||
|
|
||||||
void WatchModel::reexpandItems()
|
void WatchModel::reexpandItems()
|
||||||
{
|
{
|
||||||
foreach (const QString &iname, m_expandedINames) {
|
for (const QString &iname : qAsConst(m_expandedINames)) {
|
||||||
if (WatchItem *item = findItem(iname)) {
|
if (WatchItem *item = findItem(iname)) {
|
||||||
emit itemIsExpanded(indexForItem(item));
|
emit itemIsExpanded(indexForItem(item));
|
||||||
emit inameIsExpanded(iname);
|
emit inameIsExpanded(iname);
|
||||||
@@ -2297,7 +2298,7 @@ void WatchHandler::notifyUpdateFinished()
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach (auto item, toRemove)
|
for (WatchItem *item : qAsConst(toRemove))
|
||||||
m_model->destroyItem(item);
|
m_model->destroyItem(item);
|
||||||
|
|
||||||
m_model->forAllItems([this](WatchItem *item) {
|
m_model->forAllItems([this](WatchItem *item) {
|
||||||
@@ -2582,7 +2583,8 @@ void WatchHandler::loadSessionDataForEngine()
|
|||||||
theWatcherCount = 0;
|
theWatcherCount = 0;
|
||||||
QVariant value = SessionManager::value("Watchers");
|
QVariant value = SessionManager::value("Watchers");
|
||||||
m_model->m_watchRoot->removeChildren();
|
m_model->m_watchRoot->removeChildren();
|
||||||
foreach (const QString &exp, value.toStringList())
|
const QStringList valueList = value.toStringList();
|
||||||
|
for (const QString &exp : valueList)
|
||||||
watchExpression(exp.trimmed());
|
watchExpression(exp.trimmed());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2765,8 +2767,8 @@ void WatchHandler::addDumpers(const GdbMi &dumpers)
|
|||||||
for (const GdbMi &dumper : dumpers) {
|
for (const GdbMi &dumper : dumpers) {
|
||||||
DisplayFormats formats;
|
DisplayFormats formats;
|
||||||
formats.append(RawFormat);
|
formats.append(RawFormat);
|
||||||
QString reportedFormats = dumper["formats"].data();
|
const QStringList reportedFormats = dumper["formats"].data().split(',');
|
||||||
foreach (const QString &format, reportedFormats.split(',')) {
|
for (const QString &format : reportedFormats) {
|
||||||
if (int f = format.toInt())
|
if (int f = format.toInt())
|
||||||
formats.append(DisplayFormat(f));
|
formats.append(DisplayFormat(f));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user