Explicit pointer declarations when using the auto keyword

This commit is contained in:
Nav
2021-10-28 20:44:38 +01:00
parent 63dc3e881f
commit 1d9d482da9
19 changed files with 41 additions and 41 deletions

View File

@@ -113,7 +113,7 @@ void Insight::startup() {
* *
* This allows us to use Qt's event loop whilst still being able to process our own events. * This allows us to use Qt's event loop whilst still being able to process our own events.
*/ */
auto eventDispatchTimer = new QTimer(&(this->application)); auto* eventDispatchTimer = new QTimer(&(this->application));
QObject::connect(eventDispatchTimer, &QTimer::timeout, this, &Insight::dispatchEvents); QObject::connect(eventDispatchTimer, &QTimer::timeout, this, &Insight::dispatchEvents);
eventDispatchTimer->start(100); eventDispatchTimer->start(100);
@@ -163,7 +163,7 @@ void Insight::shutdown() {
void Insight::checkBloomVersion() { void Insight::checkBloomVersion() {
auto currentVersionNumber = Application::VERSION; auto currentVersionNumber = Application::VERSION;
auto versionQueryTask = new QueryLatestVersionNumber( auto* versionQueryTask = new QueryLatestVersionNumber(
currentVersionNumber currentVersionNumber
); );

View File

@@ -10,7 +10,7 @@
using namespace Bloom; using namespace Bloom;
void QueryLatestVersionNumber::run(TargetControllerConsole& targetControllerConsole) { void QueryLatestVersionNumber::run(TargetControllerConsole& targetControllerConsole) {
auto networkAccessManager = new QNetworkAccessManager(this); auto* networkAccessManager = new QNetworkAccessManager(this);
auto queryVersionEndpointUrl = QUrl("http://bloom.local/latest-version"); auto queryVersionEndpointUrl = QUrl("http://bloom.local/latest-version");
queryVersionEndpointUrl.setQuery(QUrlQuery({ queryVersionEndpointUrl.setQuery(QUrlQuery({
{"currentVersionNumber", QString::fromStdString(this->currentVersionNumber.toString())} {"currentVersionNumber", QString::fromStdString(this->currentVersionNumber.toString())}

View File

@@ -120,7 +120,7 @@ InsightWindow::InsightWindow(InsightWorker& insightWorker): QMainWindow(nullptr)
this->targetRegistersButton = this->container->findChild<QToolButton*>("target-registers-btn"); this->targetRegistersButton = this->container->findChild<QToolButton*>("target-registers-btn");
auto targetRegisterButtonLayout = this->targetRegistersButton->findChild<QVBoxLayout*>(); auto targetRegisterButtonLayout = this->targetRegistersButton->findChild<QVBoxLayout*>();
auto registersBtnLabel = new RotatableLabel(270, "Registers", this->targetRegistersButton); auto* registersBtnLabel = new RotatableLabel(270, "Registers", this->targetRegistersButton);
registersBtnLabel->setObjectName("target-registers-btn-label"); registersBtnLabel->setObjectName("target-registers-btn-label");
registersBtnLabel->setContentsMargins(5,0,9,0); registersBtnLabel->setContentsMargins(5,0,9,0);
targetRegisterButtonLayout->insertWidget(0, registersBtnLabel, 0, Qt::AlignTop); targetRegisterButtonLayout->insertWidget(0, registersBtnLabel, 0, Qt::AlignTop);
@@ -415,7 +415,7 @@ void InsightWindow::activate() {
continue; continue;
} }
auto variantAction = new QAction(this->variantMenu); auto* variantAction = new QAction(this->variantMenu);
variantAction->setText( variantAction->setText(
QString::fromStdString(targetVariant.name + " (" + targetVariant.packageName + ")") QString::fromStdString(targetVariant.name + " (" + targetVariant.packageName + ")")
); );

View File

@@ -18,7 +18,7 @@ UiLoader::UiLoader(QObject* parent): QUiLoader(parent) {
{ {
"PanelWidget", "PanelWidget",
[this] (QWidget* parent, const QString& name) { [this] (QWidget* parent, const QString& name) {
auto widget = new PanelWidget(parent); auto* widget = new PanelWidget(parent);
widget->setObjectName(name); widget->setObjectName(name);
widget->setStyleSheet(parent->styleSheet()); widget->setStyleSheet(parent->styleSheet());
return widget; return widget;
@@ -27,7 +27,7 @@ UiLoader::UiLoader(QObject* parent): QUiLoader(parent) {
{ {
"RotatableLabel", "RotatableLabel",
[this] (QWidget* parent, const QString& name) { [this] (QWidget* parent, const QString& name) {
auto widget = new RotatableLabel("", parent); auto* widget = new RotatableLabel("", parent);
widget->setObjectName(name); widget->setObjectName(name);
widget->setStyleSheet(parent->styleSheet()); widget->setStyleSheet(parent->styleSheet());
return widget; return widget;
@@ -36,7 +36,7 @@ UiLoader::UiLoader(QObject* parent): QUiLoader(parent) {
{ {
"ExpandingHeightScrollAreaWidget", "ExpandingHeightScrollAreaWidget",
[this] (QWidget* parent, const QString& name) { [this] (QWidget* parent, const QString& name) {
auto widget = new ExpandingHeightScrollAreaWidget(parent); auto* widget = new ExpandingHeightScrollAreaWidget(parent);
widget->setObjectName(name); widget->setObjectName(name);
widget->setStyleSheet(parent->styleSheet()); widget->setStyleSheet(parent->styleSheet());
return widget; return widget;
@@ -45,7 +45,7 @@ UiLoader::UiLoader(QObject* parent): QUiLoader(parent) {
{ {
"SvgWidget", "SvgWidget",
[this] (QWidget* parent, const QString& name) { [this] (QWidget* parent, const QString& name) {
auto widget = new SvgWidget(parent); auto* widget = new SvgWidget(parent);
widget->setObjectName(name); widget->setObjectName(name);
widget->setStyleSheet(parent->styleSheet()); widget->setStyleSheet(parent->styleSheet());
return widget; return widget;
@@ -54,7 +54,7 @@ UiLoader::UiLoader(QObject* parent): QUiLoader(parent) {
{ {
"SvgToolButton", "SvgToolButton",
[this] (QWidget* parent, const QString& name) { [this] (QWidget* parent, const QString& name) {
auto widget = new SvgToolButton(parent); auto* widget = new SvgToolButton(parent);
widget->setObjectName(name); widget->setObjectName(name);
widget->setStyleSheet(parent->styleSheet()); widget->setStyleSheet(parent->styleSheet());
return widget; return widget;
@@ -63,7 +63,7 @@ UiLoader::UiLoader(QObject* parent): QUiLoader(parent) {
{ {
"TargetPackageWidgetContainer", "TargetPackageWidgetContainer",
[this] (QWidget* parent, const QString& name) { [this] (QWidget* parent, const QString& name) {
auto widget = new InsightTargetWidgets::TargetPackageWidgetContainer(parent); auto* widget = new InsightTargetWidgets::TargetPackageWidgetContainer(parent);
widget->setObjectName(name); widget->setObjectName(name);
widget->setStyleSheet(parent->styleSheet()); widget->setStyleSheet(parent->styleSheet());
return widget; return widget;

View File

@@ -36,7 +36,7 @@ parent(parent) {
for (std::size_t i = 0; i < memorySize; i++) { for (std::size_t i = 0; i < memorySize; i++) {
const auto address = static_cast<std::uint32_t>(startAddress + i); const auto address = static_cast<std::uint32_t>(startAddress + i);
auto byteWidget = new ByteItem(i, address, this->hoveredByteWidget); auto* byteWidget = new ByteItem(i, address, this->hoveredByteWidget);
this->byteWidgetsByAddress.insert(std::pair( this->byteWidgetsByAddress.insert(std::pair(
address, address,
byteWidget byteWidget

View File

@@ -72,7 +72,7 @@ TargetMemoryInspectionPane::TargetMemoryInspectionPane(
void TargetMemoryInspectionPane::refreshMemoryValues(std::optional<std::function<void(void)>> callback) { void TargetMemoryInspectionPane::refreshMemoryValues(std::optional<std::function<void(void)>> callback) {
this->hexViewerWidget->refreshButton->setDisabled(true); this->hexViewerWidget->refreshButton->setDisabled(true);
auto readMemoryTask = new ReadTargetMemory( auto* readMemoryTask = new ReadTargetMemory(
this->targetMemoryDescriptor.type, this->targetMemoryDescriptor.type,
this->targetMemoryDescriptor.addressRange.startAddress, this->targetMemoryDescriptor.addressRange.startAddress,
this->targetMemoryDescriptor.size() this->targetMemoryDescriptor.size()

View File

@@ -17,7 +17,7 @@ BitWidget::BitWidget(
): QWidget(parent), bitIndex(bitIndex), bitNumber(bitNumber), bitset(bitset), readOnly(readOnly) { ): QWidget(parent), bitIndex(bitIndex), bitNumber(bitNumber), bitset(bitset), readOnly(readOnly) {
this->setFixedSize(BitWidget::WIDTH, BitWidget::HEIGHT); this->setFixedSize(BitWidget::WIDTH, BitWidget::HEIGHT);
auto layout = new QVBoxLayout(this); auto* layout = new QVBoxLayout(this);
layout->setSpacing(0); layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
layout->setAlignment(Qt::AlignmentFlag::AlignTop); layout->setAlignment(Qt::AlignmentFlag::AlignTop);

View File

@@ -13,7 +13,7 @@ using namespace Bloom::Widgets;
BitsetWidget::BitsetWidget(int byteNumber, unsigned char& byte, bool readOnly, QWidget* parent): BitsetWidget::BitsetWidget(int byteNumber, unsigned char& byte, bool readOnly, QWidget* parent):
QWidget(parent), byteNumber(byteNumber), byte(byte), readOnly(readOnly) { QWidget(parent), byteNumber(byteNumber), byte(byte), readOnly(readOnly) {
this->setObjectName("bitset-widget"); this->setObjectName("bitset-widget");
auto bitLayout = new QHBoxLayout(this); auto* bitLayout = new QHBoxLayout(this);
bitLayout->setSpacing(BitWidget::SPACING); bitLayout->setSpacing(BitWidget::SPACING);
bitLayout->setContentsMargins(0, 0, 0, 0); bitLayout->setContentsMargins(0, 0, 0, 0);
this->setContentsMargins(0, 0, 0, 0); this->setContentsMargins(0, 0, 0, 0);
@@ -23,7 +23,7 @@ QWidget(parent), byteNumber(byteNumber), byte(byte), readOnly(readOnly) {
); );
for (int bitIndex = (std::numeric_limits<unsigned char>::digits - 1); bitIndex >= 0; bitIndex--) { for (int bitIndex = (std::numeric_limits<unsigned char>::digits - 1); bitIndex >= 0; bitIndex--) {
auto bitWidget = new BitWidget( auto* bitWidget = new BitWidget(
bitIndex, bitIndex,
(this->byteNumber * 8) + bitIndex, (this->byteNumber * 8) + bitIndex,
this->bitset, this->bitset,

View File

@@ -27,7 +27,7 @@ RegisterHistoryItem::RegisterHistoryItem(
this->descriptionLayout->setText("Register Written"); this->descriptionLayout->setText("Register Written");
this->descriptionLayout->setObjectName("description-label"); this->descriptionLayout->setObjectName("description-label");
auto subLabelLayout = new QHBoxLayout(); auto* subLabelLayout = new QHBoxLayout();
subLabelLayout->setSpacing(0); subLabelLayout->setSpacing(0);
subLabelLayout->setContentsMargins(0, 0, 0, 0); subLabelLayout->setContentsMargins(0, 0, 0, 0);
subLabelLayout->addWidget(this->valueLabel, 0, Qt::AlignmentFlag::AlignLeft); subLabelLayout->addWidget(this->valueLabel, 0, Qt::AlignmentFlag::AlignLeft);

View File

@@ -71,9 +71,9 @@ RegisterHistoryWidget::RegisterHistoryWidget(
this->itemContainerLayout->addWidget(this->currentItem); this->itemContainerLayout->addWidget(this->currentItem);
this->currentItem->setSelected(true); this->currentItem->setSelected(true);
auto separatorWidget = new QWidget(this); auto* separatorWidget = new QWidget(this);
auto separatorLayout = new QHBoxLayout(separatorWidget); auto* separatorLayout = new QHBoxLayout(separatorWidget);
auto separatorLabel = new QLabel("Select an item to restore", separatorWidget); auto* separatorLabel = new QLabel("Select an item to restore", separatorWidget);
separatorWidget->setFixedHeight(40); separatorWidget->setFixedHeight(40);
separatorWidget->setObjectName("separator-widget"); separatorWidget->setObjectName("separator-widget");
separatorLayout->setContentsMargins(0, 10, 0, 10); separatorLayout->setContentsMargins(0, 10, 0, 10);
@@ -97,7 +97,7 @@ void RegisterHistoryWidget::selectCurrentItem() {
} }
void RegisterHistoryWidget::addItem(const Targets::TargetMemoryBuffer& registerValue, const QDateTime& changeDate) { void RegisterHistoryWidget::addItem(const Targets::TargetMemoryBuffer& registerValue, const QDateTime& changeDate) {
auto item = new RegisterHistoryItem(registerValue, changeDate, this->itemContainer); auto* item = new RegisterHistoryItem(registerValue, changeDate, this->itemContainer);
QObject::connect(item, &Item::selected, this, &RegisterHistoryWidget::onItemSelectionChange); QObject::connect(item, &Item::selected, this, &RegisterHistoryWidget::onItemSelectionChange);
this->itemContainerLayout->insertWidget(2, item); this->itemContainerLayout->insertWidget(2, item);
} }

View File

@@ -139,14 +139,14 @@ TargetRegisterInspectorWindow::TargetRegisterInspectorWindow(
* Each row of the BitsetWidget container should hold two BitsetWidgets. So we have a horizontal layout nested * Each row of the BitsetWidget container should hold two BitsetWidgets. So we have a horizontal layout nested
* within a vertical layout. * within a vertical layout.
*/ */
auto bitsetSingleHorizontalLayout = new QHBoxLayout(); auto* bitsetSingleHorizontalLayout = new QHBoxLayout();
bitsetSingleHorizontalLayout->setSpacing(BitWidget::SPACING); bitsetSingleHorizontalLayout->setSpacing(BitWidget::SPACING);
bitsetSingleHorizontalLayout->setContentsMargins(0, 0, 0, 0); bitsetSingleHorizontalLayout->setContentsMargins(0, 0, 0, 0);
// The register value will be in MSB, which is OK for us as we present the bit widgets in MSB. // The register value will be in MSB, which is OK for us as we present the bit widgets in MSB.
auto byteNumber = static_cast<int>(this->registerValue.size() - 1); auto byteNumber = static_cast<int>(this->registerValue.size() - 1);
for (std::uint32_t registerByteIndex = 0; registerByteIndex < this->registerValue.size(); registerByteIndex++) { for (std::uint32_t registerByteIndex = 0; registerByteIndex < this->registerValue.size(); registerByteIndex++) {
auto bitsetWidget = new BitsetWidget( auto* bitsetWidget = new BitsetWidget(
byteNumber, byteNumber,
this->registerValue.at(registerByteIndex), this->registerValue.at(registerByteIndex),
!this->registerDescriptor.writable, !this->registerDescriptor.writable,
@@ -308,7 +308,7 @@ void TargetRegisterInspectorWindow::updateValue() {
void TargetRegisterInspectorWindow::refreshRegisterValue() { void TargetRegisterInspectorWindow::refreshRegisterValue() {
this->registerValueContainer->setDisabled(true); this->registerValueContainer->setDisabled(true);
auto readTargetRegisterTask = new ReadTargetRegisters({this->registerDescriptor}); auto* readTargetRegisterTask = new ReadTargetRegisters({this->registerDescriptor});
QObject::connect( QObject::connect(
readTargetRegisterTask, readTargetRegisterTask,
@@ -340,7 +340,7 @@ void TargetRegisterInspectorWindow::refreshRegisterValue() {
void TargetRegisterInspectorWindow::applyChanges() { void TargetRegisterInspectorWindow::applyChanges() {
this->registerValueContainer->setDisabled(true); this->registerValueContainer->setDisabled(true);
const auto targetRegister = Targets::TargetRegister(this->registerDescriptor, this->registerValue); const auto targetRegister = Targets::TargetRegister(this->registerDescriptor, this->registerValue);
auto writeRegisterTask = new WriteTargetRegister(targetRegister); auto* writeRegisterTask = new WriteTargetRegister(targetRegister);
QObject::connect(writeRegisterTask, &InsightWorkerTask::completed, this, [this, targetRegister] { QObject::connect(writeRegisterTask, &InsightWorkerTask::completed, this, [this, targetRegister] {
this->registerValueContainer->setDisabled(false); this->registerValueContainer->setDisabled(false);
@@ -354,7 +354,7 @@ void TargetRegisterInspectorWindow::applyChanges() {
QObject::connect(writeRegisterTask, &InsightWorkerTask::failed, this, [this] (QString errorMessage) { QObject::connect(writeRegisterTask, &InsightWorkerTask::failed, this, [this] (QString errorMessage) {
this->registerValueContainer->setDisabled(false); this->registerValueContainer->setDisabled(false);
auto errorDialogue = new ErrorDialogue( auto* errorDialogue = new ErrorDialogue(
"Error", "Error",
"Failed to update " + QString::fromStdString( "Failed to update " + QString::fromStdString(
this->registerDescriptor.name.value_or("") this->registerDescriptor.name.value_or("")

View File

@@ -23,7 +23,7 @@ RegisterGroupWidget::RegisterGroupWidget(
this->headerWidget->setObjectName("register-group-header"); this->headerWidget->setObjectName("register-group-header");
this->headerWidget->setFixedHeight(25); this->headerWidget->setFixedHeight(25);
auto headerLayout = new QHBoxLayout(this->headerWidget); auto* headerLayout = new QHBoxLayout(this->headerWidget);
headerLayout->setContentsMargins(5, 0, 0, 0); headerLayout->setContentsMargins(5, 0, 0, 0);
this->label->setText(this->name); this->label->setText(this->name);
@@ -50,7 +50,7 @@ RegisterGroupWidget::RegisterGroupWidget(
headerLayout->addWidget(this->registerGroupIcon); headerLayout->addWidget(this->registerGroupIcon);
headerLayout->addWidget(this->label); headerLayout->addWidget(this->label);
auto bodyLayout = new QVBoxLayout(this->bodyWidget); auto* bodyLayout = new QVBoxLayout(this->bodyWidget);
bodyLayout->setContentsMargins(0, 0,0,0); bodyLayout->setContentsMargins(0, 0,0,0);
bodyLayout->setSpacing(0); bodyLayout->setSpacing(0);
@@ -63,7 +63,7 @@ RegisterGroupWidget::RegisterGroupWidget(
continue; continue;
} }
auto registerWidget = new RegisterWidget(descriptor, insightWorker, this->bodyWidget); auto* registerWidget = new RegisterWidget(descriptor, insightWorker, this->bodyWidget);
bodyLayout->addWidget(registerWidget, 0, Qt::AlignmentFlag::AlignTop); bodyLayout->addWidget(registerWidget, 0, Qt::AlignmentFlag::AlignTop);
QObject::connect( QObject::connect(

View File

@@ -95,12 +95,12 @@ void RegisterWidget::clearInlineValue() {
void RegisterWidget::contextMenuEvent(QContextMenuEvent* event) { void RegisterWidget::contextMenuEvent(QContextMenuEvent* event) {
this->setSelected(true); this->setSelected(true);
auto menu = new QMenu(this); auto* menu = new QMenu(this);
menu->addAction(this->openInspectionWindowAction); menu->addAction(this->openInspectionWindowAction);
menu->addAction(this->refreshValueAction); menu->addAction(this->refreshValueAction);
menu->addSeparator(); menu->addSeparator();
auto copyMenu = new QMenu("Copy", this); auto* copyMenu = new QMenu("Copy", this);
copyMenu->addAction(this->copyValueNameAction); copyMenu->addAction(this->copyValueNameAction);
copyMenu->addSeparator(); copyMenu->addSeparator();
copyMenu->addAction(this->copyValueDecimalAction); copyMenu->addAction(this->copyValueDecimalAction);
@@ -150,7 +150,7 @@ void RegisterWidget::openInspectionWindow() {
} }
void RegisterWidget::refreshValue() { void RegisterWidget::refreshValue() {
auto readRegisterTask = new ReadTargetRegisters({this->descriptor}); auto* readRegisterTask = new ReadTargetRegisters({this->descriptor});
QObject::connect( QObject::connect(
readRegisterTask, readRegisterTask,

View File

@@ -41,7 +41,7 @@ TargetRegistersPaneWidget::TargetRegistersPaneWidget(
this->container = uiLoader.load(&targetRegistersPaneUiFile, this); this->container = uiLoader.load(&targetRegistersPaneUiFile, this);
this->container->setFixedSize(parent->width(), parent->maximumHeight()); this->container->setFixedSize(parent->width(), parent->maximumHeight());
auto layout = new QVBoxLayout(this); auto* layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(this->container); layout->addWidget(this->container);
@@ -74,7 +74,7 @@ TargetRegistersPaneWidget::TargetRegistersPaneWidget(
registerDescriptors.at(TargetRegisterType::GENERAL_PURPOSE_REGISTER).end() registerDescriptors.at(TargetRegisterType::GENERAL_PURPOSE_REGISTER).end()
); );
auto generalPurposeRegisterGroupWidget = new RegisterGroupWidget( auto* generalPurposeRegisterGroupWidget = new RegisterGroupWidget(
"CPU General Purpose", "CPU General Purpose",
this->renderedDescriptors, this->renderedDescriptors,
insightWorker, insightWorker,
@@ -94,7 +94,7 @@ TargetRegistersPaneWidget::TargetRegistersPaneWidget(
} }
for (const auto& [groupName, registerDescriptors] : registerDescriptorsByGroupName) { for (const auto& [groupName, registerDescriptors] : registerDescriptorsByGroupName) {
auto registerGroupWidget = new RegisterGroupWidget( auto* registerGroupWidget = new RegisterGroupWidget(
QString::fromStdString(groupName).toUpper(), QString::fromStdString(groupName).toUpper(),
registerDescriptors, registerDescriptors,
insightWorker, insightWorker,
@@ -164,7 +164,7 @@ void TargetRegistersPaneWidget::refreshRegisterValues(std::optional<std::functio
return; return;
} }
auto readRegisterTask = new ReadTargetRegisters(descriptors); auto* readRegisterTask = new ReadTargetRegisters(descriptors);
QObject::connect( QObject::connect(
readRegisterTask, readRegisterTask,
&ReadTargetRegisters::targetRegistersRead, &ReadTargetRegisters::targetRegistersRead,

View File

@@ -40,7 +40,7 @@ DualInlinePackageWidget::DualInlinePackageWidget(
this->bottomPinLayout->setAlignment(Qt::AlignmentFlag::AlignHCenter); this->bottomPinLayout->setAlignment(Qt::AlignmentFlag::AlignHCenter);
for (const auto& [targetPinNumber, targetPinDescriptor]: targetVariant.pinDescriptorsByNumber) { for (const auto& [targetPinNumber, targetPinDescriptor]: targetVariant.pinDescriptorsByNumber) {
auto pinWidget = new PinWidget(targetPinDescriptor, targetVariant, insightWorker, this); auto* pinWidget = new PinWidget(targetPinDescriptor, targetVariant, insightWorker, this);
this->pinWidgets.push_back(pinWidget); this->pinWidgets.push_back(pinWidget);
if (targetPinNumber <= (targetVariant.pinDescriptorsByNumber.size() / 2)) { if (targetPinNumber <= (targetVariant.pinDescriptorsByNumber.size() / 2)) {

View File

@@ -74,7 +74,7 @@ PinWidget::PinWidget(
this->layout->addSpacing(3); this->layout->addSpacing(3);
if (this->isLeftLayout || this->isRightLayout) { if (this->isLeftLayout || this->isRightLayout) {
auto stackedLabelLayout = new QVBoxLayout(); auto* stackedLabelLayout = new QVBoxLayout();
stackedLabelLayout->addWidget(this->pinNameLabel); stackedLabelLayout->addWidget(this->pinNameLabel);
stackedLabelLayout->addSpacing(2); stackedLabelLayout->addSpacing(2);
stackedLabelLayout->addWidget(this->pinNumberLabel); stackedLabelLayout->addWidget(this->pinNumberLabel);

View File

@@ -58,7 +58,7 @@ QuadFlatPackageWidget::QuadFlatPackageWidget(
const auto pinCountPerLayout = static_cast<int>(targetVariant.pinDescriptorsByNumber.size() / 4); const auto pinCountPerLayout = static_cast<int>(targetVariant.pinDescriptorsByNumber.size() / 4);
for (const auto& [targetPinNumber, targetPinDescriptor]: targetVariant.pinDescriptorsByNumber) { for (const auto& [targetPinNumber, targetPinDescriptor]: targetVariant.pinDescriptorsByNumber) {
auto pinWidget = new PinWidget(targetPinDescriptor, targetVariant, insightWorker, this); auto* pinWidget = new PinWidget(targetPinDescriptor, targetVariant, insightWorker, this);
this->pinWidgets.push_back(pinWidget); this->pinWidgets.push_back(pinWidget);
if (targetPinNumber <= pinCountPerLayout) { if (targetPinNumber <= pinCountPerLayout) {

View File

@@ -32,7 +32,7 @@ TargetPackageWidget::TargetPackageWidget(
} }
void TargetPackageWidget::refreshPinStates(std::optional<std::function<void(void)>> callback) { void TargetPackageWidget::refreshPinStates(std::optional<std::function<void(void)>> callback) {
auto refreshTask = new RefreshTargetPinStates(this->targetVariant.id); auto* refreshTask = new RefreshTargetPinStates(this->targetVariant.id);
QObject::connect( QObject::connect(
refreshTask, refreshTask,
&RefreshTargetPinStates::targetPinStatesRetrieved, &RefreshTargetPinStates::targetPinStatesRetrieved,

View File

@@ -35,7 +35,7 @@ void TargetPinWidget::onWidgetBodyClicked() {
pinState.ioState = (pinState.ioState == TargetPinState::IoState::HIGH) ? pinState.ioState = (pinState.ioState == TargetPinState::IoState::HIGH) ?
TargetPinState::IoState::LOW : TargetPinState::IoState::HIGH; TargetPinState::IoState::LOW : TargetPinState::IoState::HIGH;
auto setPinStateTask = new SetTargetPinState(this->pinDescriptor, pinState); auto* setPinStateTask = new SetTargetPinState(this->pinDescriptor, pinState);
QObject::connect(setPinStateTask, &InsightWorkerTask::completed, this, [this, pinState] { QObject::connect(setPinStateTask, &InsightWorkerTask::completed, this, [this, pinState] {
this->updatePinState(pinState); this->updatePinState(pinState);
this->setDisabled(false); this->setDisabled(false);