mirror of
https://github.com/PCSX2/pcsx2.git
synced 2025-12-16 04:08:48 +00:00
debugger: cache thread list in model
This commit is contained in:
parent
9e2a73c7a7
commit
f7677105ed
@ -23,13 +23,11 @@ int ThreadModel::columnCount(const QModelIndex&) const
|
||||
|
||||
QVariant ThreadModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
const std::vector<std::unique_ptr<BiosThread>> threads = m_cpu.GetThreadList();
|
||||
|
||||
size_t row = static_cast<size_t>(index.row());
|
||||
if (row >= threads.size())
|
||||
if (row >= m_threads.size())
|
||||
return QVariant();
|
||||
|
||||
const BiosThread* thread = threads[row].get();
|
||||
const BiosThread* thread = m_threads[row].get();
|
||||
|
||||
if (role == Qt::DisplayRole)
|
||||
{
|
||||
@ -128,5 +126,6 @@ QVariant ThreadModel::headerData(int section, Qt::Orientation orientation, int r
|
||||
void ThreadModel::refreshData()
|
||||
{
|
||||
beginResetModel();
|
||||
m_threads = m_cpu.GetThreadList();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
@ -88,4 +88,5 @@ private:
|
||||
};
|
||||
|
||||
DebugInterface& m_cpu;
|
||||
std::vector<std::unique_ptr<BiosThread>> m_threads;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user