summaryrefslogtreecommitdiff
path: root/Applications/ProcessManager
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-06 19:56:47 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-06 19:56:47 +0100
commit7df1121e1c25044578e8dad87b954e5bfbe7e5f9 (patch)
treea5a0a10c7cb5b0c3278d77f0c581133c0affedb1 /Applications/ProcessManager
parentdc4e6dd7bcb5b529d7f7ba159d458d153036bb3f (diff)
downloadserenity-7df1121e1c25044578e8dad87b954e5bfbe7e5f9.zip
LibGUI: GTableModel::data() should take a GModelIndex instead of int,int.
Diffstat (limited to 'Applications/ProcessManager')
-rw-r--r--Applications/ProcessManager/ProcessTableModel.cpp8
-rw-r--r--Applications/ProcessManager/ProcessTableModel.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/Applications/ProcessManager/ProcessTableModel.cpp b/Applications/ProcessManager/ProcessTableModel.cpp
index f157661625..2bc49400c7 100644
--- a/Applications/ProcessManager/ProcessTableModel.cpp
+++ b/Applications/ProcessManager/ProcessTableModel.cpp
@@ -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;
diff --git a/Applications/ProcessManager/ProcessTableModel.h b/Applications/ProcessManager/ProcessTableModel.h
index 47899b712e..35b1145a37 100644
--- a/Applications/ProcessManager/ProcessTableModel.h
+++ b/Applications/ProcessManager/ProcessTableModel.h
@@ -15,7 +15,7 @@ public:
virtual int column_count() const override;
virtual String column_name(int column) const override;
virtual ColumnMetadata column_metadata(int column) const override;
- virtual GVariant data(int row, int column) const override;
+ virtual GVariant data(const GModelIndex&) const override;
virtual void update() override;
pid_t selected_pid() const;