diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2024-03-10 00:06:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-10 00:06:21 +0100 |
| commit | ef75a6ff232d743ca9f4552c850eb3f8afaa3e6e (patch) | |
| tree | 0a05e793ca95f5aa22d9b291195012c96696323f /Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp | |
| parent | 4f8fb645d6ec889cf4f9dd85507bdc29b4fde0d0 (diff) | |
| parent | 0645b4d5792111cc992b85cda6694c95ab43408f (diff) | |
Merge pull request #12622 from mitaclaw/branch-watch-dialog-errata
BranchWatchDialog: Fix Misc. Errata
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp b/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp index f5e6a5acc3..f45da30d20 100644 --- a/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp +++ b/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp @@ -504,15 +504,9 @@ BranchWatchDialog::BranchWatchDialog(Core::System& system, Core::BranchWatch& br restoreGeometry(settings.value(QStringLiteral("branchwatchdialog/geometry")).toByteArray()); } -void BranchWatchDialog::done(int r) +BranchWatchDialog::~BranchWatchDialog() { - if (m_timer->isActive()) - m_timer->stop(); - auto& settings = Settings::GetQSettings(); - settings.setValue(QStringLiteral("branchwatchdialog/geometry"), saveGeometry()); - settings.setValue(QStringLiteral("branchwatchdialog/tableheader/state"), - m_table_view->horizontalHeader()->saveState()); - QDialog::done(r); + SaveSettings(); } static constexpr int BRANCH_WATCH_TOOL_TIMER_DELAY_MS = 100; @@ -523,18 +517,18 @@ static bool TimerCondition(const Core::BranchWatch& branch_watch, Core::State st return branch_watch.GetRecordingActive() && state > Core::State::Paused; } -int BranchWatchDialog::exec() +void BranchWatchDialog::hideEvent(QHideEvent* event) { - if (TimerCondition(m_branch_watch, Core::GetState())) - m_timer->start(BRANCH_WATCH_TOOL_TIMER_DELAY_MS); - return QDialog::exec(); + if (m_timer->isActive()) + m_timer->stop(); + QDialog::hideEvent(event); } -void BranchWatchDialog::open() +void BranchWatchDialog::showEvent(QShowEvent* event) { if (TimerCondition(m_branch_watch, Core::GetState())) m_timer->start(BRANCH_WATCH_TOOL_TIMER_DELAY_MS); - QDialog::open(); + QDialog::showEvent(event); } void BranchWatchDialog::OnStartPause(bool checked) @@ -927,6 +921,14 @@ void BranchWatchDialog::OnTableCopyAddress(QModelIndexList index_list) QApplication::clipboard()->setText(text); } +void BranchWatchDialog::SaveSettings() +{ + auto& settings = Settings::GetQSettings(); + settings.setValue(QStringLiteral("branchwatchdialog/geometry"), saveGeometry()); + settings.setValue(QStringLiteral("branchwatchdialog/tableheader/state"), + m_table_view->horizontalHeader()->saveState()); +} + void BranchWatchDialog::Update() { if (m_branch_watch.GetRecordingPhase() == Core::BranchWatch::Phase::Blacklist) |
