Changeset View
Changeset View
Standalone View
Standalone View
processui/ProcessFilter.cpp
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | 101 | break; | |||
---|---|---|---|---|---|
102 | default: | 102 | default: | ||
103 | break; | 103 | break; | ||
104 | } | 104 | } | ||
105 | 105 | | |||
106 | if(accepted) { | 106 | if(accepted) { | ||
107 | if(filterRegExp().isEmpty()) return true; | 107 | if(filterRegExp().isEmpty()) return true; | ||
108 | 108 | | |||
109 | //Allow the user to search by PID | 109 | //Allow the user to search by PID | ||
110 | if(QString::number(process->pid()).contains(filterRegExp())) return true; | 110 | if(QString::number(process->pid()).contains(filterRegExp())) | ||
111 | 111 | return true; | |||
112 | //None of our tests have rejected it. Pass it on to qsortfilterproxymodel's filter | 112 | //None of our tests have rejected it. Pass it on to qsortfilterproxymodel's filter | ||
113 | if(QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent)) | 113 | if(QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent)) | ||
114 | return true; | 114 | return true; | ||
115 | } | | |||
116 | 115 | | |||
116 | auto strings = filterRegExp().pattern().split(QLatin1Char(','), QString::SplitBehavior::SkipEmptyParts); | ||||
117 | for (auto string : strings) { | ||||
118 | string = string.trimmed(); | ||||
119 | if (process->name().indexOf(string) != -1 || QString::number(process->pid()).indexOf(string) != -1) { | ||||
120 | return true; | ||||
121 | } | ||||
122 | } | ||||
123 | } | ||||
117 | 124 | | |||
118 | //We did not accept this row at all. | 125 | //We did not accept this row at all. | ||
119 | 126 | | |||
120 | //If we are in flat mode, then give up now | 127 | //If we are in flat mode, then give up now | ||
121 | if(mFilter != AllProcessesInTreeForm) | 128 | if(mFilter != AllProcessesInTreeForm) | ||
122 | return false; | 129 | return false; | ||
123 | 130 | | |||
124 | //one of our children might be accepted, so accept this row if our children are accepted. | 131 | //one of our children might be accepted, so accept this row if our children are accepted. | ||
Show All 24 Lines |