mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Refactored key handlers.
Made the logic more modular, hopefully easier to follow, and removed repeated code. Plus, some optimization in RichString code.
This commit is contained in:
@ -1047,16 +1047,12 @@ void ProcessList_expandTree(ProcessList* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessList_rebuildPanel(ProcessList* this, bool flags, int following, bool userOnly, uid_t userId, const char* incFilter) {
|
||||
void ProcessList_rebuildPanel(ProcessList* this, bool flags, int following, const char* incFilter) {
|
||||
if (!flags) {
|
||||
following = this->following;
|
||||
userOnly = this->userOnly;
|
||||
userId = this->userId;
|
||||
incFilter = this->incFilter;
|
||||
} else {
|
||||
this->following = following;
|
||||
this->userOnly = userOnly;
|
||||
this->userId = userId;
|
||||
this->incFilter = incFilter;
|
||||
}
|
||||
|
||||
@ -1072,7 +1068,7 @@ void ProcessList_rebuildPanel(ProcessList* this, bool flags, int following, bool
|
||||
Process* p = ProcessList_get(this, i);
|
||||
|
||||
if ( (!p->show)
|
||||
|| (userOnly && (p->st_uid != userId))
|
||||
|| (this->userOnly && (p->st_uid != this->userId))
|
||||
|| (incFilter && !(String_contains_i(p->comm, incFilter)))
|
||||
|| (this->pidWhiteList && !Hashtable_get(this->pidWhiteList, p->pid)) )
|
||||
hidden = true;
|
||||
|
Reference in New Issue
Block a user