mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibCore: Report error condition when reading process statistics failed
This commit is contained in:
parent
754bf22da7
commit
cf89180c35
Notes:
sideshowbarker
2024-07-19 00:08:32 +09:00
Author: https://github.com/tomuta
Commit: cf89180c35
Pull-request: https://github.com/SerenityOS/serenity/pull/4736
12 changed files with 94 additions and 74 deletions
|
@ -50,14 +50,15 @@ void RunningProcessesModel::update()
|
|||
|
||||
Core::ProcessStatisticsReader reader;
|
||||
auto processes = reader.get_all();
|
||||
|
||||
for (auto& it : processes) {
|
||||
Process process;
|
||||
process.pid = it.value.pid;
|
||||
process.uid = it.value.uid;
|
||||
process.icon = FileIconProvider::icon_for_executable(it.value.executable).bitmap_for_size(16);
|
||||
process.name = it.value.name;
|
||||
m_processes.append(move(process));
|
||||
if (processes.has_value()) {
|
||||
for (auto& it : processes.value()) {
|
||||
Process process;
|
||||
process.pid = it.value.pid;
|
||||
process.uid = it.value.uid;
|
||||
process.icon = FileIconProvider::icon_for_executable(it.value.executable).bitmap_for_size(16);
|
||||
process.name = it.value.name;
|
||||
m_processes.append(move(process));
|
||||
}
|
||||
}
|
||||
|
||||
did_update();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue