Skip to content

Commit

Permalink
formatted for clang
Browse files Browse the repository at this point in the history
  • Loading branch information
jahorta committed Jul 13, 2024
1 parent 95c8bbc commit d36266e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
13 changes: 7 additions & 6 deletions Source/GUI/MemWatcher/Dialogs/DlgAddWatchEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void DlgAddWatchEntry::fillFields(MemWatchEntry* entry)
m_offsets.append(txbOffset);
QLabel* lblAddressOfPath = new QLabel();
lblAddressOfPath->setText(
QString::fromStdString(" -> " + m_entry->getAddressStringForPointerLevel(i + 1)));
QString::fromStdString(" -> " + m_entry->getAddressStringForPointerLevel(i + 1)));
lblAddressOfPath->setProperty("addr", m_entry->getAddressForPointerLevel(i + 1));
lblAddressOfPath->setContextMenuPolicy(Qt::CustomContextMenu);
connect(lblAddressOfPath, &QWidget::customContextMenuRequested, this,
Expand Down Expand Up @@ -198,10 +198,11 @@ void DlgAddWatchEntry::addPointerOffset()
m_offsets.append(txbOffset);
QLabel* lblAddressOfPath = new QLabel(" -> ");
lblAddressOfPath->setText(
QString::fromStdString(" -> " + m_entry->getAddressStringForPointerLevel(level + 1)));
QString::fromStdString(" -> " + m_entry->getAddressStringForPointerLevel(level + 1)));
lblAddressOfPath->setProperty("addr", m_entry->getAddressForPointerLevel(level + 1));
lblAddressOfPath->setContextMenuPolicy(Qt::CustomContextMenu);
connect(lblAddressOfPath, &QWidget::customContextMenuRequested, this, &DlgAddWatchEntry::onPointerOffsetContextMenuRequested);
connect(lblAddressOfPath, &QWidget::customContextMenuRequested, this,
&DlgAddWatchEntry::onPointerOffsetContextMenuRequested);
m_addressPath.append(lblAddressOfPath);
m_offsetsLayout->addWidget(lblLevel, level, 0);
m_offsetsLayout->addWidget(txbOffset, level, 1);
Expand Down Expand Up @@ -397,9 +398,9 @@ void DlgAddWatchEntry::updatePreview()
for (int i = 0; i < level; ++i)
{
QLabel* lblAddressOfPath =
qobject_cast<QLabel*>(m_offsetsLayout->itemAtPosition(i, 2)->widget());
qobject_cast<QLabel*>(m_offsetsLayout->itemAtPosition(i, 2)->widget());
lblAddressOfPath->setText(
QString::fromStdString(" -> " + m_entry->getAddressStringForPointerLevel(i + 1)));
QString::fromStdString(" -> " + m_entry->getAddressStringForPointerLevel(i + 1)));
lblAddressOfPath->setProperty("addr", m_entry->getAddressForPointerLevel(i + 1));
}
}
Expand Down Expand Up @@ -447,7 +448,7 @@ void DlgAddWatchEntry::onPointerOffsetContextMenuRequested(const QPoint& pos)

const QString text{QString::number(lbl->property("addr").toUInt(), 16).toUpper()};
connect(copyAddr, &QAction::triggered, this,
[text] { QApplication::clipboard()->setText(text); });
[text] { QApplication::clipboard()->setText(text); });
contextMenu->addAction(copyAddr);

if (!lbl->property("addr").toUInt())
Expand Down
11 changes: 5 additions & 6 deletions Source/GUI/MemWatcher/MemWatchWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,19 +282,18 @@ void MemWatchWidget::onMemWatchContextMenuRequested(const QPoint& pos)
QAction* const copyPointer = new QAction(tr("Copy &base address..."), this);
const QString addrString{QString::number(entry->getConsoleAddress(), 16).toUpper()};
connect(copyPointer, &QAction::triggered, this,
[addrString] { QApplication::clipboard()->setText(addrString);
});
[addrString] { QApplication::clipboard()->setText(addrString); });
copyAddrSubmenu->addAction(copyPointer);
for (int i = 0; i < static_cast<int>(entry->getPointerLevel()); ++i)
{
if (!entry->getAddressForPointerLevel(i + 1))
break;
QAction* const copyAddrOfPointer =
new QAction(tr("Copy pointed address at &level %1...").arg(i + 1), this);
new QAction(tr("Copy pointed address at &level %1...").arg(i + 1), this);
const QString addrString{
QString::number(entry->getAddressForPointerLevel(i + 1), 16).toUpper()};
QString::number(entry->getAddressForPointerLevel(i + 1), 16).toUpper()};
connect(copyAddrOfPointer, &QAction::triggered, this,
[addrString] { QApplication::clipboard()->setText(addrString); });
[addrString] { QApplication::clipboard()->setText(addrString); });
copyAddrSubmenu->addAction(copyAddrOfPointer);
}
}
Expand All @@ -303,7 +302,7 @@ void MemWatchWidget::onMemWatchContextMenuRequested(const QPoint& pos)
QAction* const copyPointer = new QAction(tr("Copy add&ress"), this);
const QString addrString{QString::number(entry->getConsoleAddress(), 16).toUpper()};
connect(copyPointer, &QAction::triggered, this,
[addrString] { QApplication::clipboard()->setText(addrString); });
[addrString] { QApplication::clipboard()->setText(addrString); });
contextMenu->addAction(copyPointer);
}
}
Expand Down

0 comments on commit d36266e

Please sign in to comment.