summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2019-07-06 10:50:11 +0200
committerJosJuice <josjuice@gmail.com>2019-07-06 11:30:17 +0200
commit92a655c8b90c62255bcd3fcc160e240c98f79217 (patch)
tree8c3fbc41272e1ffb63bdd2315668fd573a386489 /Source/Core/DolphinQt/Debugger/CodeWidget.cpp
parent0a7395bfba99719f71de5186a9916e66c1901f37 (diff)
DolphinQt: Don't update debug widgets when hidden
Saves on CPU usage when pausing/unpausing with the debugger disabled. This is especially important when using frame advance rapidly.
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/CodeWidget.cpp')
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeWidget.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
index 443da54042..def631f87e 100644
--- a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
@@ -64,8 +64,6 @@ CodeWidget::CodeWidget(QWidget* parent) : QDockWidget(parent)
settings.value(QStringLiteral("codewidget/codesplitter")).toByteArray());
m_box_splitter->restoreState(
settings.value(QStringLiteral("codewidget/boxsplitter")).toByteArray());
-
- Update();
}
CodeWidget::~CodeWidget()
@@ -83,6 +81,11 @@ void CodeWidget::closeEvent(QCloseEvent*)
Settings::Instance().SetCodeVisible(false);
}
+void CodeWidget::showEvent(QShowEvent* event)
+{
+ Update();
+}
+
void CodeWidget::CreateWidgets()
{
auto* layout = new QGridLayout;
@@ -265,6 +268,9 @@ void CodeWidget::SetAddress(u32 address, CodeViewWidget::SetAddressUpdate update
void CodeWidget::Update()
{
+ if (!isVisible())
+ return;
+
const Common::Symbol* symbol = g_symbolDB.GetSymbolFromAddr(m_code_view->GetAddress());
UpdateCallstack();