diff --git a/Userland/Applications/SystemMonitor/ProcessModel.cpp b/Userland/Applications/SystemMonitor/ProcessModel.cpp index bc0fe5bb12..8369c9b966 100644 --- a/Userland/Applications/SystemMonitor/ProcessModel.cpp +++ b/Userland/Applications/SystemMonitor/ProcessModel.cpp @@ -255,7 +255,7 @@ GUI::Variant ProcessModel::data(GUI::ModelIndex const& index, GUI::ModelRole rol VERIFY_NOT_REACHED(); } - if (role == GUI::ModelRole::Display) { + if (role == GUI::ModelRole::Display || role == DISPLAY_VERBOSE) { switch (index.column()) { case Column::Icon: return icon_for(thread); @@ -306,17 +306,29 @@ GUI::Variant ProcessModel::data(GUI::ModelIndex const& index, GUI::ModelRole rol case Column::CowFaults: return thread.current_state.cow_faults; case Column::IPv4SocketReadBytes: - return human_readable_size_long(thread.current_state.ipv4_socket_read_bytes, UseThousandsSeparator::Yes); + if (role == DISPLAY_VERBOSE) + return human_readable_size_long(thread.current_state.ipv4_socket_read_bytes, UseThousandsSeparator::Yes); + return human_readable_size(thread.current_state.ipv4_socket_read_bytes, AK::HumanReadableBasedOn::Base2, UseThousandsSeparator::Yes); case Column::IPv4SocketWriteBytes: - return human_readable_size_long(thread.current_state.ipv4_socket_write_bytes, UseThousandsSeparator::Yes); + if (role == DISPLAY_VERBOSE) + return human_readable_size_long(thread.current_state.ipv4_socket_write_bytes, UseThousandsSeparator::Yes); + return human_readable_size(thread.current_state.ipv4_socket_write_bytes, AK::HumanReadableBasedOn::Base2, UseThousandsSeparator::Yes); case Column::UnixSocketReadBytes: - return human_readable_size_long(thread.current_state.unix_socket_read_bytes, UseThousandsSeparator::Yes); + if (role == DISPLAY_VERBOSE) + return human_readable_size_long(thread.current_state.unix_socket_read_bytes, UseThousandsSeparator::Yes); + return human_readable_size(thread.current_state.unix_socket_read_bytes, AK::HumanReadableBasedOn::Base2, UseThousandsSeparator::Yes); case Column::UnixSocketWriteBytes: - return human_readable_size_long(thread.current_state.unix_socket_write_bytes, UseThousandsSeparator::Yes); + if (role == DISPLAY_VERBOSE) + return human_readable_size_long(thread.current_state.unix_socket_write_bytes, UseThousandsSeparator::Yes); + return human_readable_size(thread.current_state.unix_socket_write_bytes, AK::HumanReadableBasedOn::Base2, UseThousandsSeparator::Yes); case Column::FileReadBytes: - return human_readable_size_long(thread.current_state.file_read_bytes, UseThousandsSeparator::Yes); + if (role == DISPLAY_VERBOSE) + return human_readable_size_long(thread.current_state.file_read_bytes, UseThousandsSeparator::Yes); + return human_readable_size(thread.current_state.file_read_bytes, AK::HumanReadableBasedOn::Base2, UseThousandsSeparator::Yes); case Column::FileWriteBytes: - return human_readable_size_long(thread.current_state.file_write_bytes, UseThousandsSeparator::Yes); + if (role == DISPLAY_VERBOSE) + return human_readable_size_long(thread.current_state.file_write_bytes, UseThousandsSeparator::Yes); + return human_readable_size(thread.current_state.file_write_bytes, AK::HumanReadableBasedOn::Base2, UseThousandsSeparator::Yes); case Column::Pledge: return thread.current_state.pledge; case Column::Veil: diff --git a/Userland/Applications/SystemMonitor/ProcessModel.h b/Userland/Applications/SystemMonitor/ProcessModel.h index f6c95f1ad7..f833fd9c51 100644 --- a/Userland/Applications/SystemMonitor/ProcessModel.h +++ b/Userland/Applications/SystemMonitor/ProcessModel.h @@ -55,6 +55,8 @@ public: __Count }; + static constexpr GUI::ModelRole DISPLAY_VERBOSE = static_cast(0x101); + static ErrorOr read_command_line(pid_t pid); static ProcessModel& the(); diff --git a/Userland/Applications/SystemMonitor/ProcessStateWidget.cpp b/Userland/Applications/SystemMonitor/ProcessStateWidget.cpp index 2eac9a3665..fa057d5e96 100644 --- a/Userland/Applications/SystemMonitor/ProcessStateWidget.cpp +++ b/Userland/Applications/SystemMonitor/ProcessStateWidget.cpp @@ -50,7 +50,7 @@ public: } return m_target.column_name(index.row()).release_value_but_fixme_should_propagate_errors(); } - return m_target_index.sibling_at_column(index.row()).data(); + return m_target_index.sibling_at_column(index.row()).data(ProcessModel::DISPLAY_VERBOSE); } if (role == GUI::ModelRole::Font) {