MCPcopy Create free account
hub / github.com/benapetr/TuxManager / filterAcceptsRow

Method filterAcceptsRow

src/os/processfilterproxy.cpp:47–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47bool 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
72bool ProcessFilterProxy::isKernelTask(const Process &proc)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected