| 45 | } |
| 46 | |
| 47 | bool ProcessFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const |
| 48 | { |
| 49 | const auto *model = qobject_cast<const ProcessModel *>(this->sourceModel()); |
| 50 | if (!model) |
| 51 | return true; |
| 52 | |
| 53 | const QList<Process> &procs = model->GetProcesses(); |
| 54 | if (sourceRow < 0 || sourceRow >= procs.size()) |
| 55 | return false; |
| 56 | |
| 57 | const Process &proc = procs.at(sourceRow); |
| 58 | |
| 59 | // ── Kernel task filter ─────────────────────────────────────────────────── |
| 60 | if (!this->ShowKernelTasks && isKernelTask(proc)) |
| 61 | return false; |
| 62 | |
| 63 | // ── Other-users filter ─────────────────────────────────────────────────── |
| 64 | if (!this->ShowOtherUsersProcs && proc.UID != this->m_myUid) |
| 65 | return false; |
| 66 | |
| 67 | // ── Free-text search (delegate to base class) ──────────────────────────── |
| 68 | return QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent); |
| 69 | } |
| 70 | |
| 71 | // static |
| 72 | bool ProcessFilterProxy::isKernelTask(const Process &proc) |
nothing calls this directly
no outgoing calls
no test coverage detected