Add receiver arguments to lambda connects
MODIFY
external/VSRTL
external/VSRTL
-Subproject commit eca7337db6bccdc30b86d92d3ba83baa12576e7d
+Subproject commit bfc51f9860bf783c33716c25fd1523ded7cb0a49

MODIFY
src/cachesim/cacheconfigwidget.cpp
src/cachesim/cacheconfigwidget.cpp
@@ -37,12 +37,12 @@ void CacheConfigWidget::setCache(const std::shared_ptr<CacheSim>& cache) {
connect(m_ui->blocks, QOverload<int>::of(&QSpinBox::valueChanged), m_cache.get(), &CacheSim::setBlocks);
connect(m_ui->lines, QOverload<int>::of(&QSpinBox::valueChanged), m_cache.get(), &CacheSim::setLines);
- connect(m_ui->replacementPolicy, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) {
+ connect(m_ui->replacementPolicy, QOverload<int>::of(&QComboBox::currentIndexChanged), cache.get(), [=](int index) {
m_cache->setReplacementPolicy(qvariant_cast<ReplPolicy>(m_ui->replacementPolicy->itemData(index)));
});
- connect(m_ui->wrHit, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(m_ui->wrHit, QOverload<int>::of(&QComboBox::currentIndexChanged), cache.get(),
[=](int index) { m_cache->setWritePolicy(qvariant_cast<WritePolicy>(m_ui->wrHit->itemData(index))); });
- connect(m_ui->wrMiss, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) {
+ connect(m_ui->wrMiss, QOverload<int>::of(&QComboBox::currentIndexChanged), cache.get(), [=](int index) {
m_cache->setWriteAllocatePolicy(qvariant_cast<WriteAllocPolicy>(m_ui->wrMiss->itemData(index)));
});
connect(m_ui->savePresetButton, &QPushButton::clicked, this, &CacheConfigWidget::storePreset);
@@ -53,7 +53,7 @@ void CacheConfigWidget::setCache(const std::shared_ptr<CacheSim>& cache) {
m_ui->removePresetButton->setToolTip("Delete cache preset");
connect(m_cache.get(), &CacheSim::configurationChanged, this, &CacheConfigWidget::handleConfigurationChanged);
- connect(m_cache.get(), &CacheSim::configurationChanged, [=] { emit configurationChanged(); });
+ connect(m_cache.get(), &CacheSim::configurationChanged, this, [=] { emit configurationChanged(); });
setupPresets();
handleConfigurationChanged();
@@ -108,7 +108,7 @@ void CacheConfigWidget::setupPresets() {
m_ui->presets->addItem(preset.name, QVariant::fromValue<CachePreset>(preset));
}
- connect(m_ui->presets, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) {
+ connect(m_ui->presets, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=](int index) {
if (index == -1) {
return;
}

MODIFY
src/cachesim/cachewidget.cpp
src/cachesim/cachewidget.cpp
@@ -20,7 +20,7 @@ CacheWidget::CacheWidget(QWidget* parent) : QWidget(parent), m_ui(new Ui::CacheW
auto* cacheGraphic = new CacheGraphic(*m_cacheSim);
m_scene->addItem(cacheGraphic);
- connect(m_cacheSim.get(), &CacheSim::configurationChanged, [=] {
+ connect(m_cacheSim.get(), &CacheSim::configurationChanged, this, [=] {
RipesSettings::getObserver(RIPES_GLOBALSIGNAL_REQRESET)->trigger();
auto cacheViews = m_scene->views();

MODIFY
src/cachetab.cpp
src/cachetab.cpp
@@ -12,12 +12,12 @@ CacheTab::CacheTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolbar, paren
m_ui->setupUi(this);
// During processor running, it should not be possible to interact with the cache tab
- connect(ProcessorHandler::get(), &ProcessorHandler::runStarted, [=] { setEnabled(false); });
- connect(ProcessorHandler::get(), &ProcessorHandler::runFinished, [=] { setEnabled(true); });
+ connect(ProcessorHandler::get(), &ProcessorHandler::runStarted, this, [=] { setEnabled(false); });
+ connect(ProcessorHandler::get(), &ProcessorHandler::runFinished, this, [=] { setEnabled(true); });
connect(m_ui->cacheView, &CacheView::cacheAddressSelected, this, &CacheTab::focusAddressChanged);
- connect(m_ui->cacheTabWidget, &CacheTabWidget::cacheFocusChanged, [=](CacheWidget* widget) {
+ connect(m_ui->cacheTabWidget, &CacheTabWidget::cacheFocusChanged, this, [=](CacheWidget* widget) {
m_ui->cacheView->setScene(widget->getScene());
m_ui->cacheView->fitScene();
});

MODIFY
src/edittab.cpp
src/edittab.cpp
@@ -65,15 +65,16 @@ EditTab::EditTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolbar, parent)
connect(m_ui->setCInput, &QRadioButton::toggled, m_buildAction, &QAction::setEnabled);
// Ensure that changes to the current compiler path will disable C input, if the compiler is invalid
- connect(&CCManager::get(), &CCManager::ccChanged, [=](auto res) {
+ connect(&CCManager::get(), &CCManager::ccChanged, this, [=](auto res) {
if (!res.success) {
m_ui->setAssemblyInput->setChecked(true);
}
});
// During processor running, it should not be possible to build the program
- connect(ProcessorHandler::get(), &ProcessorHandler::runStarted, [=] { m_buildAction->setEnabled(false); });
- connect(ProcessorHandler::get(), &ProcessorHandler::runFinished,
+ connect(ProcessorHandler::get(), &ProcessorHandler::runStarted, m_buildAction,
+ [=] { m_buildAction->setEnabled(false); });
+ connect(ProcessorHandler::get(), &ProcessorHandler::runFinished, m_buildAction,
[=] { m_buildAction->setEnabled(m_ui->setCInput->isChecked()); });
connect(ProcessorHandler::get(), &ProcessorHandler::procStateChangedNonRun, this,
&EditTab::updateProgramViewerHighlighting);
@@ -88,7 +89,7 @@ EditTab::EditTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolbar, parent)
m_ui->splitter->setStretchFactor(2, 0);
// State preservation
- connect(RipesSettings::getObserver(RIPES_GLOBALSIGNAL_QUIT), &SettingObserver::modified, [=] {
+ connect(RipesSettings::getObserver(RIPES_GLOBALSIGNAL_QUIT), &SettingObserver::modified, this, [=] {
RipesSettings::setValue(RIPES_SETTING_SOURCECODE, m_ui->codeEditor->document()->toPlainText());
RipesSettings::setValue(RIPES_SETTING_INPUT_TYPE, m_currentSourceType);
});

MODIFY
src/io/iomanager.cpp
src/io/iomanager.cpp
@@ -91,8 +91,9 @@ void IOManager::unregisterPeripheralWithProcessor(IOBase* peripheral) {
IOBase* IOManager::createPeripheral(IOType type, unsigned forcedId) {
auto* peripheral = IOFactories.at(type)(nullptr);
- connect(peripheral, &IOBase::sizeChanged, [=] { this->peripheralSizeChanged(peripheral); });
- connect(peripheral, &IOBase::aboutToDelete, [=](std::atomic<bool>& ok) { this->removePeripheral(peripheral, ok); });
+ connect(peripheral, &IOBase::sizeChanged, this, [=] { this->peripheralSizeChanged(peripheral); });
+ connect(peripheral, &IOBase::aboutToDelete, this,
+ [=](std::atomic<bool>& ok) { this->removePeripheral(peripheral, ok); });
if (forcedId != UINT_MAX) {
peripheral->setID(forcedId);

MODIFY
src/iotab.cpp
src/iotab.cpp
@@ -121,7 +121,7 @@ IOBase* IOTab::createPeripheral(IOType type, int forcedID) {
* itself is resized. It seems a bit cumbersome, but this was the only way i wound to trigger both the QMainWindow
* and the outer MDIWindow to register that its child widget has changed in size, and adjust itself accordingly.
*/
- connect(peripheral, &IOBase::paramsChanged, [=] {
+ connect(peripheral, &IOBase::paramsChanged, this, [=] {
// Ensure that a peripheral resize event, as a result of a parameter being changed, as been processed, so that
// its new size has taken effect.
QApplication::processEvents();

MODIFY
src/loaddialog.cpp
src/loaddialog.cpp
@@ -47,8 +47,8 @@ LoadDialog::LoadDialog(QWidget* parent) : QDialog(parent), m_ui(new Ui::LoadDial
m_ui->binaryEntryPoint->setValidator(validator);
m_ui->binaryEntryPoint->setText("0x" + QString("0").repeated(ProcessorHandler::currentISA()->bytes() * 2));
- connect(m_ui->binaryLoadAt, &QLineEdit::textChanged, [=] { this->validateCurrentFile(); });
- connect(m_ui->binaryEntryPoint, &QLineEdit::textChanged, [=] { this->validateCurrentFile(); });
+ connect(m_ui->binaryLoadAt, &QLineEdit::textChanged, this, [=] { this->validateCurrentFile(); });
+ connect(m_ui->binaryEntryPoint, &QLineEdit::textChanged, this, [=] { this->validateCurrentFile(); });
// ELF page
m_ui->currentISA->setText(ProcessorHandler::currentISA()->name());

MODIFY
src/memorytab.cpp
src/memorytab.cpp
@@ -19,8 +19,8 @@ MemoryTab::MemoryTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolbar, par
m_ui->memoryViewerWidget->updateView();
// During processor running, it should not be possible to interact with the memory viewer or cache widgets
- connect(ProcessorHandler::get(), &ProcessorHandler::runStarted, [=] { setEnabled(false); });
- connect(ProcessorHandler::get(), &ProcessorHandler::runFinished, [=] { setEnabled(true); });
+ connect(ProcessorHandler::get(), &ProcessorHandler::runStarted, this, [=] { setEnabled(false); });
+ connect(ProcessorHandler::get(), &ProcessorHandler::runFinished, this, [=] { setEnabled(true); });
m_ui->memoryMapView->setModel(new MemoryMapModel(&IOManager::get(), this));
m_ui->memoryMapView->horizontalHeader()->setSectionResizeMode(MemoryMapModel::Name, QHeaderView::ResizeToContents);

MODIFY
src/processorhandler.cpp
src/processorhandler.cpp
@@ -34,7 +34,7 @@ ProcessorHandler::ProcessorHandler() {
// The m_procStateChangeTimer limits maximum frequency of which the procStateChangedNonRun is emitted.
m_procStateChangeTimer.setSingleShot(true);
m_procStateChangeTimer.setInterval(1000.0 / RipesSettings::value(RIPES_SETTING_UIUPDATEPS).toUInt());
- connect(RipesSettings::getObserver(RIPES_SETTING_UIUPDATEPS), &SettingObserver::modified, [=] {
+ connect(RipesSettings::getObserver(RIPES_SETTING_UIUPDATEPS), &SettingObserver::modified, this, [=] {
m_procStateChangeTimer.setInterval(1000.0 / RipesSettings::value(RIPES_SETTING_UIUPDATEPS).toUInt());
});
@@ -151,11 +151,11 @@ void ProcessorHandler::_run() {
emit runStarted();
// Start running through the VSRTL Widget interface
- connect(&m_runWatcher, &QFutureWatcher<void>::finished, [=] {
+ connect(&m_runWatcher, &QFutureWatcher<void>::finished, this, [=] {
emit runFinished();
_triggerProcStateChangeTimer();
});
- connect(&m_runWatcher, &QFutureWatcher<void>::finished, [=] { ProcessorStatusManager::clearStatus(); });
+ connect(&m_runWatcher, &QFutureWatcher<void>::finished, this, [=] { ProcessorStatusManager::clearStatus(); });
m_runWatcher.setFuture(QtConcurrent::run([=] {
auto* vsrtl_proc = dynamic_cast<vsrtl::SimDesign*>(m_currentProcessor.get());

MODIFY
src/programviewer.cpp
src/programviewer.cpp
@@ -355,8 +355,9 @@ void BreakpointArea::contextMenuEvent(QContextMenuEvent* event) {
auto* toggleAction = contextMenu.addAction("Toggle breakpoint");
auto* removeAllAction = contextMenu.addAction("Remove all breakpoints");
- connect(toggleAction, &QAction::triggered, [=] { m_programViewer->breakpointClick(event->pos()); });
- connect(removeAllAction, &QAction::triggered, [=] {
+ connect(toggleAction, &QAction::triggered, m_programViewer,
+ [=] { m_programViewer->breakpointClick(event->pos()); });
+ connect(removeAllAction, &QAction::triggered, m_programViewer, [=] {
m_programViewer->clearBreakpoints();
repaint();
});

MODIFY
src/radixselectorwidget.cpp
src/radixselectorwidget.cpp
@@ -30,7 +30,7 @@ void RadixSelectorWidget::setupRadixComboBox() {
m_ui->displayType->addItem(rt.second, QVariant::fromValue(rt.first));
}
- connect(m_ui->displayType, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) {
+ connect(m_ui->displayType, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=](int index) {
const Radix r = qvariant_cast<Radix>(m_ui->displayType->itemData(index));
emit radixChanged(r);
});

MODIFY
src/registerinitializationwidget.cpp
src/registerinitializationwidget.cpp
@@ -11,7 +11,7 @@ std::map<ProcessorID, RegisterInitialization> RegisterInitializationWidget::m_in
RegisterSelectionComboBox::RegisterSelectionComboBox(RegisterInitializationWidget* parent)
: QComboBox(parent), m_parent(parent) {
- connect(this, QOverload<int>::of(&QComboBox::currentIndexChanged), [=] {
+ connect(this, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=] {
const int oldIdx = m_index;
m_index = currentData().toUInt();
emit regIndexChanged(oldIdx, m_index);

MODIFY
src/settingsdialog.cpp
src/settingsdialog.cpp
@@ -76,9 +76,9 @@ std::pair<QLabel*, T_TriggerWidget*> createSettingsWidgets(const QString& settin
// deleted once the dialog is closed, to avoid a dangling connection between the settings object and the trigger
// widget.
auto conn = settingObserver->connect(settingObserver, &SettingObserver::modified, colorSetterFunctor);
- widget->connect(widget, &QObject::destroyed, [=] { settingObserver->disconnect(conn); });
+ widget->connect(widget, &QObject::destroyed, settingObserver, [=] { settingObserver->disconnect(conn); });
- widget->connect(widget, &QPushButton::clicked, [=](bool) {
+ widget->connect(widget, &QPushButton::clicked, settingObserver, [=](bool) {
QColorDialog diag;
diag.setCurrentColor(settingObserver->value().value<QColor>());
if (diag.exec()) {
@@ -100,10 +100,10 @@ std::pair<QLabel*, T_TriggerWidget*> createSettingsWidgets(const QString& settin
// We want changes in the set font to propagate to the button, while in the dialog. But this connection must be
// deleted once the dialog is closed, to avoid a dangling connection between the settings object and the trigger
// widget.
- auto conn = settingObserver->connect(settingObserver, &SettingObserver::modified, fontSetterFunctor);
- widget->connect(widget, &QObject::destroyed, [=] { settingObserver->disconnect(conn); });
+ auto conn = settingObserver->connect(settingObserver, &SettingObserver::modified, widget, fontSetterFunctor);
+ widget->connect(widget, &QObject::destroyed, settingObserver, [=] { settingObserver->disconnect(conn); });
- widget->connect(widget, &QPushButton::clicked, [=](bool) {
+ widget->connect(widget, &QPushButton::clicked, settingObserver, [=](bool) {
QFontDialog diag;
diag.setCurrentFont(settingObserver->value().value<QFont>());
diag.setOption(QFontDialog::MonospacedFonts, true);

Add receiver arguments to lambda connects