diff --git a/Applications/SystemMonitor/ProcessModel.cpp b/Applications/SystemMonitor/ProcessModel.cpp index ac9717f1bc..d4c6db21bd 100644 --- a/Applications/SystemMonitor/ProcessModel.cpp +++ b/Applications/SystemMonitor/ProcessModel.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -274,16 +275,12 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol if (role == GUI::ModelRole::Display) { switch (index.column()) { - case Column::Icon: - if (thread.current_state.icon_id != -1) { - auto icon_buffer = SharedBuffer::create_from_shbuf_id(thread.current_state.icon_id); - if (icon_buffer) { - auto icon_bitmap = Gfx::Bitmap::create_with_shared_buffer(Gfx::BitmapFormat::RGBA32, *icon_buffer, { 16, 16 }); - if (icon_bitmap) - return *icon_bitmap; - } - } + case Column::Icon: { + auto icon = GUI::FileIconProvider::icon_for_path(thread.current_state.executable); + if (auto* bitmap = icon.bitmap_for_size(16)) + return *bitmap; return *m_generic_process_icon; + } case Column::PID: return thread.current_state.pid; case Column::TID: @@ -384,9 +381,9 @@ void ProcessModel::update() state.amount_clean_inode = it.value.amount_clean_inode; state.amount_purgeable_volatile = it.value.amount_purgeable_volatile; state.amount_purgeable_nonvolatile = it.value.amount_purgeable_nonvolatile; - state.icon_id = it.value.icon_id; state.name = thread.name; + state.executable = it.value.executable; state.ppid = it.value.ppid; state.tid = thread.tid; diff --git a/Applications/SystemMonitor/ProcessModel.h b/Applications/SystemMonitor/ProcessModel.h index 8739a2df69..9c79d0fcc5 100644 --- a/Applications/SystemMonitor/ProcessModel.h +++ b/Applications/SystemMonitor/ProcessModel.h @@ -118,6 +118,7 @@ private: unsigned times_scheduled; unsigned ticks_user; unsigned ticks_kernel; + String executable; String name; String state; String user; @@ -143,7 +144,6 @@ private: unsigned file_read_bytes; unsigned file_write_bytes; float cpu_percent; - int icon_id; }; struct Thread { diff --git a/Applications/SystemMonitor/main.cpp b/Applications/SystemMonitor/main.cpp index 11e1fd36d7..cbb04bcffd 100644 --- a/Applications/SystemMonitor/main.cpp +++ b/Applications/SystemMonitor/main.cpp @@ -137,12 +137,17 @@ int main(int argc, char** argv) return 1; } - if (unveil("/bin/Profiler", "x") < 0) { + if (unveil("/bin", "r") < 0) { perror("unveil"); return 1; } - if (unveil("/bin/Inspector", "x") < 0) { + if (unveil("/bin/Profiler", "rx") < 0) { + perror("unveil"); + return 1; + } + + if (unveil("/bin/Inspector", "rx") < 0) { perror("unveil"); return 1; }