Commit 62c85cb1 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

gdb: port foreach -> range-based for

parent a4e6c0aa
......@@ -146,7 +146,8 @@ void DebugSession::configInferior(ILaunchConfiguration *cfg, IExecutePlugin *iex
if (breakOnStart) {
BreakpointModel* m = ICore::self()->debugController()->breakpointModel();
bool found = false;
foreach (Breakpoint *b, m->breakpoints()) {
const auto breakpoints = m->breakpoints();
for (Breakpoint* b : breakpoints) {
if (b->location() == QLatin1String("main")) {
found = true;
break;
......
......@@ -299,8 +299,8 @@ void MemoryView::contextMenuEvent(QContextMenuEvent *e)
hex->setShortcut(Qt::Key_H);
formatMenu->addAction(hex);
foreach(QAction* act, formatGroup->actions())
{
const auto formatActions = formatGroup->actions();
for (QAction* act : formatActions) {
act->setCheckable(true);
act->setChecked(act->data().toInt() == m_memViewView->valueCoding());
act->setShortcutContext(Qt::WidgetWithChildrenShortcut);
......@@ -341,8 +341,8 @@ void MemoryView::contextMenuEvent(QContextMenuEvent *e)
group16->setShortcut(Qt::Key_6);
groupingMenu->addAction(group16);
foreach(QAction* act, groupingGroup->actions())
{
const auto groupingActions = groupingGroup->actions();
for (QAction* act : groupingActions) {
act->setCheckable(true);
act->setChecked(act->data().toInt() == m_memViewView->noOfGroupedBytes());
act->setShortcutContext(Qt::WidgetWithChildrenShortcut);
......
......@@ -2034,7 +2034,8 @@ void GdbTest::testDebugInExternalTerminal()
{
TestLaunchConfiguration cfg;
foreach (const QString & console, QStringList() << "konsole" << "xterm" << "xfce4-terminal" << "gnome-terminal") {
const QStringList consoles { "konsole", "xterm", "xfce4-terminal", "gnome-terminal" };
for (const QString& console : consoles) {
TestDebugSession* session = nullptr;
if (QStandardPaths::findExecutable(console).isEmpty()) {
......
......@@ -60,7 +60,7 @@ public:
<< "from kde import register_kde_printers"
<< "register_kde_printers (None)"
<< "end";
foreach (const QByteArray &i, p) {
for (const QByteArray& i : qAsConst(p)) {
write(i + "\n");
}
waitForPrompt();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment