Skip to content
Permalink
Browse files
Merge pull request #9565 from sepalani/qt-blocker
BreakpointWidget: Use QSignalBlocker
  • Loading branch information
leoetlino committed Mar 5, 2021
2 parents a4de250 + 1e6dfc6 commit adcdeda
Showing 1 changed file with 15 additions and 13 deletions.
@@ -6,6 +6,7 @@

#include <QHeaderView>
#include <QMenu>
#include <QSignalBlocker>
#include <QTableWidget>
#include <QToolBar>
#include <QVBoxLayout>
@@ -262,9 +263,8 @@ void BreakpointWidget::OnDelete()

if (is_memcheck)
{
Settings::Instance().blockSignals(true);
const QSignalBlocker blocker(Settings::Instance());
PowerPC::memchecks.Remove(address);
Settings::Instance().blockSignals(false);
}
else
{
@@ -278,9 +278,10 @@ void BreakpointWidget::OnDelete()
void BreakpointWidget::OnClear()
{
PowerPC::debug_interface.ClearAllBreakpoints();
Settings::Instance().blockSignals(true);
PowerPC::debug_interface.ClearAllMemChecks();
Settings::Instance().blockSignals(false);
{
const QSignalBlocker blocker(Settings::Instance());
PowerPC::debug_interface.ClearAllMemChecks();
}

m_table->setRowCount(0);

@@ -314,9 +315,8 @@ void BreakpointWidget::OnLoad()
if (ini.GetLines("MemoryBreakPoints", &new_mcs, false))
{
PowerPC::memchecks.Clear();
Settings::Instance().blockSignals(true);
const QSignalBlocker blocker(Settings::Instance());
PowerPC::memchecks.AddFromStrings(new_mcs);
Settings::Instance().blockSignals(false);
}

emit BreakpointsChanged();
@@ -410,9 +410,10 @@ void BreakpointWidget::AddAddressMBP(u32 addr, bool on_read, bool on_write, bool
check.log_on_hit = do_log;
check.break_on_hit = do_break;

Settings::Instance().blockSignals(true);
PowerPC::memchecks.Add(check);
Settings::Instance().blockSignals(false);
{
const QSignalBlocker blocker(Settings::Instance());
PowerPC::memchecks.Add(check);
}

emit BreakpointsChanged();
Update();
@@ -431,9 +432,10 @@ void BreakpointWidget::AddRangedMBP(u32 from, u32 to, bool on_read, bool on_writ
check.log_on_hit = do_log;
check.break_on_hit = do_break;

Settings::Instance().blockSignals(true);
PowerPC::memchecks.Add(check);
Settings::Instance().blockSignals(false);
{
const QSignalBlocker blocker(Settings::Instance());
PowerPC::memchecks.Add(check);
}

emit BreakpointsChanged();
Update();

0 comments on commit adcdeda

Please sign in to comment.