mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 00:25:07 +00:00
LibGUI: Use FileIconProvider in RunningProcessesModel
This was the last remaining client of the per-process icon_id.
This commit is contained in:
parent
2e846631a8
commit
cb68b8ff8b
1 changed files with 2 additions and 6 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <AK/SharedBuffer.h>
|
||||
#include <LibCore/ProcessStatisticsReader.h>
|
||||
#include <LibGUI/FileIconProvider.h>
|
||||
#include <LibGUI/RunningProcessesModel.h>
|
||||
|
||||
namespace GUI {
|
||||
|
@ -54,13 +55,8 @@ void RunningProcessesModel::update()
|
|||
Process process;
|
||||
process.pid = it.value.pid;
|
||||
process.uid = it.value.uid;
|
||||
if (it.value.icon_id != -1) {
|
||||
if (auto icon_buffer = SharedBuffer::create_from_shbuf_id(it.value.icon_id)) {
|
||||
process.icon = Gfx::Bitmap::create_with_shared_buffer(Gfx::BitmapFormat::RGBA32, *icon_buffer, { 16, 16 });
|
||||
}
|
||||
}
|
||||
process.icon = FileIconProvider::icon_for_path(it.value.executable).bitmap_for_size(16);
|
||||
process.name = it.value.name;
|
||||
|
||||
m_processes.append(move(process));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue