Add mode to hide/show system processes.

This commit is contained in:
Ernie Pasveer
2021-11-21 12:00:15 -06:00
parent a9e57dcf1d
commit f1f21d4f35
5 changed files with 48 additions and 25 deletions
+10 -2
View File
@@ -11,7 +11,7 @@
#include <QStandardPaths>
#include <QTextStream>
QProcessList QProcessInfo::enumerate() {
QProcessList QProcessInfo::populate(bool showSystemProcesses) {
QProcessList ret;
@@ -90,7 +90,15 @@ QProcessList QProcessInfo::enumerate() {
cmdline.close();
}
ret.push_back(info);
// Add the process to the list. If it is a system process ([]), only add it
// if we're allowed.
if (info.name()[0] == '[') {
if (showSystemProcesses == true) {
ret.push_back(info);
}
}else{
ret.push_back(info);
}
}
}