CheatsManager/CheatSearchWidget: Avoid Global System Accessor

OnResetClicked and GenerateARCode appear to have been using the CPUThreadGuard in error.
This commit is contained in:
mitaclaw
2024-03-01 08:07:13 -08:00
parent 551dcec0b1
commit c377c1e21e
5 changed files with 28 additions and 19 deletions

View File

@ -18,6 +18,10 @@ namespace ActionReplay
{
struct ARCode;
}
namespace Core
{
class System;
}
class QCheckBox;
class QComboBox;
@ -36,7 +40,9 @@ class CheatSearchWidget : public QWidget
{
Q_OBJECT
public:
explicit CheatSearchWidget(std::unique_ptr<Cheats::CheatSearchSessionBase> session);
explicit CheatSearchWidget(Core::System& system,
std::unique_ptr<Cheats::CheatSearchSessionBase> session,
QWidget* parent = nullptr);
~CheatSearchWidget() override;
enum class UpdateSource
@ -74,6 +80,8 @@ private:
int GetVisibleRowsBeginIndex() const;
int GetVisibleRowsEndIndex() const;
Core::System& m_system;
std::unique_ptr<Cheats::CheatSearchSessionBase> m_session;
// storage for the 'Current Value' column's data