From 5f81babad2508d541167c2c2cdccc5b7c893e120 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 16 Feb 2021 20:24:22 +0100 Subject: [PATCH] SystemMonitor: Remove some unused cruft in ProcessModel --- Userland/Applications/SystemMonitor/ProcessModel.cpp | 11 +---------- Userland/Applications/SystemMonitor/ProcessModel.h | 9 ++------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/Userland/Applications/SystemMonitor/ProcessModel.cpp b/Userland/Applications/SystemMonitor/ProcessModel.cpp index d8eb125efe..d346408483 100644 --- a/Userland/Applications/SystemMonitor/ProcessModel.cpp +++ b/Userland/Applications/SystemMonitor/ProcessModel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, Andreas Kling + * Copyright (c) 2018-2021, Andreas Kling * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,15 +25,11 @@ */ #include "ProcessModel.h" -#include "GraphWidget.h" -#include #include #include #include #include #include -#include -#include static ProcessModel* s_the; @@ -48,9 +44,6 @@ ProcessModel::ProcessModel() ASSERT(!s_the); s_the = this; m_generic_process_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/gear.png"); - m_high_priority_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/highpriority.png"); - m_low_priority_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/lowpriority.png"); - m_normal_priority_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/normalpriority.png"); auto file = Core::File::construct("/proc/cpuinfo"); if (file->open(Core::IODevice::ReadOnly)) { @@ -264,7 +257,6 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol return thread.current_state.veil; } ASSERT_NOT_REACHED(); - return {}; } if (role == GUI::ModelRole::Display) { @@ -385,7 +377,6 @@ void ProcessModel::update() state.tid = thread.tid; state.pgid = it.value.pgid; state.sid = it.value.sid; - state.times_scheduled = thread.times_scheduled; state.ticks_user = thread.ticks_user; state.ticks_kernel = thread.ticks_kernel; state.cpu = thread.cpu; diff --git a/Userland/Applications/SystemMonitor/ProcessModel.h b/Userland/Applications/SystemMonitor/ProcessModel.h index a7db7aebca..45e0e10780 100644 --- a/Userland/Applications/SystemMonitor/ProcessModel.h +++ b/Userland/Applications/SystemMonitor/ProcessModel.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, Andreas Kling + * Copyright (c) 2018-2021, Andreas Kling * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -96,7 +96,7 @@ public: float total_cpu_percent { 0.0 }; float total_cpu_percent_kernel { 0.0 }; - CpuInfo(u32 id) + explicit CpuInfo(u32 id) : id(id) { } @@ -115,7 +115,6 @@ private: pid_t ppid; pid_t pgid; pid_t sid; - unsigned times_scheduled; unsigned ticks_user; unsigned ticks_kernel; String executable; @@ -151,14 +150,10 @@ private: ThreadState previous_state; }; - HashMap m_usernames; HashMap> m_threads; NonnullOwnPtrVector m_cpus; Vector m_pids; RefPtr m_generic_process_icon; - RefPtr m_high_priority_icon; - RefPtr m_low_priority_icon; - RefPtr m_normal_priority_icon; RefPtr m_proc_all; };