debugger: cache module list in model

This commit is contained in:
Ziemas 2025-05-21 14:19:59 +02:00 committed by Ty
parent e50fe50daf
commit 1eb9a60b4a
2 changed files with 4 additions and 4 deletions

View File

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

View File

@ -48,4 +48,5 @@ public:
private:
DebugInterface& m_cpu;
std::vector<IopMod> m_modules;
};