@@ -186,7 +186,7 @@ void MainWindow::debugImportFile(const QString &file) {
186186 }
187187}
188188
189- void MainWindow::debugExportFile (const QString &filename) {
189+ void MainWindow::debugExportFile (const QString &filename) const {
190190 if (filename.isEmpty ()) {
191191 return ;
192192 }
@@ -500,7 +500,7 @@ void MainWindow::debugCommand(int reason, uint32_t data) {
500500 debugRaise ();
501501}
502502
503- void MainWindow::debugSync () {
503+ void MainWindow::debugSync () const {
504504 if (!guiDebug) {
505505 return ;
506506 }
@@ -589,7 +589,7 @@ void MainWindow::debugSync() {
589589 }
590590}
591591
592- void MainWindow::debugGuiState (bool state) {
592+ void MainWindow::debugGuiState (bool state) const {
593593 if (state) {
594594 ui->buttonRun ->setText (tr (" Run" ));
595595 ui->buttonRun ->setIcon (m_iconRun);
@@ -866,7 +866,7 @@ void MainWindow::debugPopulate() {
866866// Clock items
867867// ------------------------------------------------
868868
869- void MainWindow::debugZeroCycles () {
869+ void MainWindow::debugZeroCycles () const {
870870 debug.totalCycles = 0 ;
871871 debug.dmaCycles = 0 ;
872872 debug.flashCacheMisses = 0 ;
@@ -924,7 +924,7 @@ void MainWindow::breakRemove(uint32_t address) {
924924 }
925925}
926926
927- int MainWindow::breakGetMask (int row) {
927+ int MainWindow::breakGetMask (int row) const {
928928 int mask;
929929 if (static_cast <QAbstractButton *>(m_breakpoints->cellWidget (row, BREAK_ENABLE_COL))->isChecked ()) {
930930 mask = DBG_MASK_EXEC;
@@ -993,11 +993,11 @@ void MainWindow::breakModified(QTableWidgetItem *item) {
993993 memUpdate ();
994994}
995995
996- QString MainWindow::breakNextLabel () {
996+ QString MainWindow::breakNextLabel () const {
997997 return QStringLiteral (" Label" ) + QString::number (m_breakpoints->rowCount ());
998998}
999999
1000- QString MainWindow::watchNextLabel () {
1000+ QString MainWindow::watchNextLabel () const {
10011001 return QStringLiteral (" Label" ) + QString::number (m_watchpoints->rowCount ());
10021002}
10031003
@@ -1140,7 +1140,7 @@ void MainWindow::portSetPrev(QTableWidgetItem *current, [[maybe_unused]] QTableW
11401140 }
11411141}
11421142
1143- void MainWindow::portRemoveRow (int row) {
1143+ void MainWindow::portRemoveRow (int row) const {
11441144 uint16_t port = static_cast <uint16_t >(hex2int (m_ports->item (row, PORT_ADDR_COL)->text ()));
11451145 debug_ports (port, ~DBG_MASK_NONE, false );
11461146 m_ports->removeRow (row);
@@ -1155,7 +1155,7 @@ void MainWindow::portRemoveSelected() {
11551155 }
11561156}
11571157
1158- void MainWindow::portPopulate (int currRow) {
1158+ void MainWindow::portPopulate (int currRow) const {
11591159 uint16_t port = static_cast <uint16_t >(hex2int (m_ports->item (currRow, PORT_ADDR_COL)->text ()));
11601160 uint8_t read = static_cast <uint8_t >(port_peek_byte (port));
11611161
@@ -1242,7 +1242,7 @@ bool MainWindow::portAdd(uint16_t port, int mask, bool unset) {
12421242 return true ;
12431243}
12441244
1245- int MainWindow::portGetMask (int row) {
1245+ int MainWindow::portGetMask (int row) const {
12461246 unsigned int mask = 0 ;
12471247 if (static_cast <QAbstractButton *>(m_ports->cellWidget (row, PORT_READ_COL))->isChecked ()) {
12481248 mask |= DBG_MASK_PORT_READ;
@@ -1589,7 +1589,7 @@ void MainWindow::memUpdate() {
15891589 memDocksUpdate ();
15901590}
15911591
1592- int MainWindow::watchGetMask (int row) {
1592+ int MainWindow::watchGetMask (int row) const {
15931593 int mask = 0 ;
15941594 if (static_cast <QAbstractButton *>(m_watchpoints->cellWidget (row, WATCH_READ_COL))->isChecked ()) {
15951595 mask |= DBG_MASK_READ;
@@ -1735,7 +1735,7 @@ void MainWindow::batterySetCharging(bool checked) {
17351735 control.batteryCharging = checked;
17361736}
17371737
1738- void MainWindow::batterySet (int value) {
1738+ void MainWindow::batterySet (int value) const {
17391739 control.setBatteryStatus = static_cast <uint8_t >(value);
17401740 ui->sliderBattery ->setValue (value);
17411741 ui->labelBattery ->setText (QString::number (value * 20 ) + " %" );
@@ -1917,14 +1917,14 @@ void MainWindow::equatesAddEquate(const QString &name, uint32_t address) {
19171917}
19181918
19191919bool MainWindow::equatesAddEquateInternal (const QString &name, uint32_t address) {
1920- std::pair< map_value_t ::iterator, bool > inserted = disasm.reverse .emplace (name.toUpper ().toStdString (), address);
1921- if (!inserted. second ) {
1922- uint32_t oldAddress = std::exchange (inserted. first ->second , address);
1920+ auto [mapIter, inserted] = disasm.reverse .emplace (name.toUpper ().toStdString (), address);
1921+ if (!inserted) {
1922+ const uint32_t oldAddress = std::exchange (mapIter ->second , address);
19231923 if (oldAddress == address) {
19241924 return false ;
19251925 }
1926- std::pair< map_t ::iterator, map_t ::iterator> range = disasm.map .equal_range (oldAddress);
1927- for (map_t ::iterator it = range. first ; it != range. second ; ) {
1926+ auto [addrIt, nameIt] = disasm.map .equal_range (oldAddress);
1927+ for (auto it = addrIt ; it != nameIt ; ) {
19281928 if (name.compare (QString::fromStdString (it->second ), Qt::CaseInsensitive) == 0 ) {
19291929 it = disasm.map .erase (it);
19301930 } else {
@@ -2004,7 +2004,7 @@ void MainWindow::gotoDisasmAddr(uint32_t address) {
20042004 ui->disasm ->setFocus ();
20052005}
20062006
2007- QAction *MainWindow::gotoDisasmAction (QMenu *menu) {
2007+ QAction *MainWindow::gotoDisasmAction (QMenu *menu) const {
20082008 QAction *gotoDisasm = menu->addAction (ACTION_GOTO_DISASM_VIEW);
20092009 gotoDisasm->setEnabled (m_uiEditMode || ui->debugDisassemblyWidget ->isVisible ());
20102010 return gotoDisasm;
@@ -2047,7 +2047,7 @@ HexWidget *MainWindow::gotoMemAddrNoRaise(uint32_t address) {
20472047 return memWidget;
20482048}
20492049
2050- QAction *MainWindow::gotoMemAction (QMenu *menu, bool vat) {
2050+ QAction *MainWindow::gotoMemAction (QMenu *menu, bool vat) const {
20512051 QAction *gotoMem = menu->addAction (vat ? ACTION_GOTO_VAT_MEMORY_VIEW : ACTION_GOTO_MEMORY_VIEW);
20522052 gotoMem->setEnabled (m_uiEditMode || ui->debugMemoryWidget ->isVisible () || !m_docksMemory.isEmpty ());
20532053 return gotoMem;
@@ -2220,7 +2220,7 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *e) {
22202220// Stack
22212221// ------------------------------------------------
22222222
2223- bool MainWindow::adlState (int state) {
2223+ bool MainWindow::adlState (int state) const {
22242224 bool adl = ui->checkADL ->isChecked ();
22252225 if (state == Qt::Checked) {
22262226 adl = true ;
@@ -2454,7 +2454,7 @@ void MainWindow::osUpdate() {
24542454 connect (ui->fpStack , &QTableWidget::itemChanged, this , &MainWindow::fpModified);
24552455}
24562456
2457- void MainWindow::opModified (QTableWidgetItem *item) {
2457+ void MainWindow::opModified (QTableWidgetItem *item) const {
24582458 if (item == Q_NULLPTR) {
24592459 return ;
24602460 }
@@ -2519,7 +2519,7 @@ void MainWindow::opModified(QTableWidgetItem *item) {
25192519 sender ()->blockSignals (false );
25202520}
25212521
2522- void MainWindow::fpModified (QTableWidgetItem *item) {
2522+ void MainWindow::fpModified (QTableWidgetItem *item) const {
25232523 if (item == Q_NULLPTR) {
25242524 return ;
25252525 }
@@ -2637,7 +2637,7 @@ void MainWindow::contextVat(const QPoint &posa) {
26372637 }
26382638}
26392639
2640- void MainWindow::memDocksUpdate () {
2640+ void MainWindow::memDocksUpdate () const {
26412641 QList<QDockWidget*> docks = findChildren<QDockWidget*>();
26422642 foreach (QDockWidget* dock, docks) {
26432643 if (dock->windowTitle ().contains (TXT_MEM_DOCK)) {
0 commit comments