summaryrefslogtreecommitdiff
path: root/Userland/Applications
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2022-12-08 14:50:31 +0100
committerLinus Groh <mail@linusgroh.de>2022-12-10 11:49:24 +0000
commit8940f2da7fec4b4e375777c861e65ff04465f255 (patch)
treed1ac58cae77af94ea378a93fb818e8787faed542 /Userland/Applications
parente338a0656dd8e99e9ed64abf98d15e219adb9755 (diff)
downloadserenity-8940f2da7fec4b4e375777c861e65ff04465f255.zip
LibCore: Use `Core::Stream` for `ProcessStatisticsReader`
Diffstat (limited to 'Userland/Applications')
-rw-r--r--Userland/Applications/SystemMonitor/ProcessModel.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Applications/SystemMonitor/ProcessModel.cpp b/Userland/Applications/SystemMonitor/ProcessModel.cpp
index 9310688d9c..119913ea45 100644
--- a/Userland/Applications/SystemMonitor/ProcessModel.cpp
+++ b/Userland/Applications/SystemMonitor/ProcessModel.cpp
@@ -433,16 +433,16 @@ void ProcessModel::update()
HashTable<int> live_tids;
u64 total_time_scheduled_diff = 0;
- if (all_processes.has_value()) {
+ if (!all_processes.is_error()) {
if (m_has_total_scheduled_time)
- total_time_scheduled_diff = all_processes->total_time_scheduled - m_total_time_scheduled;
+ total_time_scheduled_diff = all_processes.value().total_time_scheduled - m_total_time_scheduled;
- m_total_time_scheduled = all_processes->total_time_scheduled;
- m_total_time_scheduled_kernel = all_processes->total_time_scheduled_kernel;
+ m_total_time_scheduled = all_processes.value().total_time_scheduled;
+ m_total_time_scheduled_kernel = all_processes.value().total_time_scheduled_kernel;
m_has_total_scheduled_time = true;
- for (size_t i = 0; i < all_processes->processes.size(); ++i) {
- auto const& process = all_processes->processes[i];
+ for (size_t i = 0; i < all_processes.value().processes.size(); ++i) {
+ auto const& process = all_processes.value().processes[i];
NonnullOwnPtr<Process>* process_state = nullptr;
for (size_t i = 0; i < m_processes.size(); ++i) {
auto* other_process = &m_processes.ptr_at(i);
@@ -549,7 +549,7 @@ void ProcessModel::update()
on_cpu_info_change(m_cpus);
if (on_state_update)
- on_state_update(all_processes.has_value() ? all_processes->processes.size() : 0, m_threads.size());
+ on_state_update(!all_processes.is_error() ? all_processes.value().processes.size() : 0, m_threads.size());
// FIXME: This is a rather hackish way of invalidating indices.
// It would be good if GUI::Model had a way to orchestrate removal/insertion while preserving indices.