From 7c2a39706e84d112cf28883a64afe43aa6f0b916 Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Fri, 20 Sep 2024 18:37:39 -0700 Subject: DolphinQt: A Ubiquitous Signal For When Breakpoints Change There were three distinct mechanisms for signaling breakpoint changes in DolphinQt, and the wiring had room for improvement. The behavior of these signals has been consolidated into the new `Host::PPCBreakpointsChanged` signal, which can be emitted from anywhere in DolphinQt to properly update breakpoints everywhere in DolphinQt. This improves a few things: - For the `CodeViewWidget` and `MemoryViewWidget`, signals no longer need to propagate through the `CodeWidget` and `MemoryWidget` (respectively) to reach their destination (incoming or outgoing). - For the `BreakpointWidget`, by self-triggering from its own signal, it no longer must manually call `Update()` after all of the emission sites. - For the `BranchWatchDialog`, it now has one less thing it must go through the `CodeWidget` for, which is a plus. --- Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp') diff --git a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp index ed1ab0c7cb..1cb8c71544 100644 --- a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp @@ -188,6 +188,8 @@ CodeViewWidget::CodeViewWidget() }); connect(Host::GetInstance(), &Host::PPCSymbolsChanged, this, qOverload<>(&CodeViewWidget::Update)); + connect(Host::GetInstance(), &Host::PPCBreakpointsChanged, this, + qOverload<>(&CodeViewWidget::Update)); connect(&Settings::Instance(), &Settings::ThemeChanged, this, qOverload<>(&CodeViewWidget::Update)); @@ -1139,16 +1141,14 @@ void CodeViewWidget::ToggleBreakpoint() { m_system.GetPowerPC().GetBreakPoints().ToggleBreakPoint(GetContextAddress()); - emit BreakpointsChanged(); - Update(); + emit Host::GetInstance()->PPCBreakpointsChanged(); } void CodeViewWidget::AddBreakpoint() { m_system.GetPowerPC().GetBreakPoints().Add(GetContextAddress()); - emit BreakpointsChanged(); - Update(); + emit Host::GetInstance()->PPCBreakpointsChanged(); } u32 CodeViewWidget::GetContextAddress() const -- cgit v1.2.3