mirror of
https://github.com/PCSX2/pcsx2.git
synced 2025-12-16 04:08:48 +00:00
debugger: cache module list in model
This commit is contained in:
parent
e50fe50daf
commit
1eb9a60b4a
@ -24,13 +24,11 @@ int ModuleModel::columnCount(const QModelIndex&) const
|
||||
|
||||
QVariant ModuleModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
const std::vector<IopMod> Modules = m_cpu.GetModuleList();
|
||||
|
||||
size_t row = static_cast<size_t>(index.row());
|
||||
if (row >= Modules.size())
|
||||
if (row >= m_modules.size())
|
||||
return QVariant();
|
||||
|
||||
const IopMod* mod = &Modules[row];
|
||||
const IopMod* mod = &m_modules[row];
|
||||
|
||||
if (role == Qt::DisplayRole)
|
||||
{
|
||||
@ -130,5 +128,6 @@ QVariant ModuleModel::headerData(int section, Qt::Orientation orientation, int r
|
||||
void ModuleModel::refreshData()
|
||||
{
|
||||
beginResetModel();
|
||||
m_modules = m_cpu.GetModuleList();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
@ -48,4 +48,5 @@ public:
|
||||
|
||||
private:
|
||||
DebugInterface& m_cpu;
|
||||
std::vector<IopMod> m_modules;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user