LibGUI: GTableModel::data() should take a GModelIndex instead of int,int.

This commit is contained in:
Andreas Kling 2019-03-06 19:56:47 +01:00
parent dc4e6dd7bc
commit 7df1121e1c
Notes: sideshowbarker 2024-07-19 15:09:46 +09:00
6 changed files with 12 additions and 12 deletions

View file

@ -80,12 +80,12 @@ static String pretty_byte_size(size_t size)
return String::format("%uK", size / 1024);
}
GVariant ProcessTableModel::data(int row, int column) const
GVariant ProcessTableModel::data(const GModelIndex& index) const
{
ASSERT(is_valid({ row, column }));
auto it = m_processes.find(m_pids[row]);
ASSERT(is_valid(index));
auto it = m_processes.find(m_pids[index.row()]);
auto& process = *(*it).value;
switch (column) {
switch (index.column()) {
case Column::Icon: return *m_generic_process_icon;
case Column::PID: return process.current_state.pid;
case Column::State: return process.current_state.state;