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.
This commit is contained in:
JosJuice
2019-07-06 10:50:11 +02:00
parent 0a7395bfba
commit 92a655c8b9
14 changed files with 108 additions and 32 deletions

View File

@ -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();