699
709
if (process->state == 'Z') {
700
710
free(process->comm);
701
process->comm = String_copy(command);
711
process->comm = strdup(command);
702
712
} else if (Process_isThread(process)) {
703
713
if (this->showThreadNames || Process_isKernelThread(process) || process->state == 'Z') {
704
714
free(process->comm);
705
process->comm = String_copy(command);
715
process->comm = strdup(command);
706
716
} else if (this->showingThreadNames) {
707
717
if (! ProcessList_readCmdlineFile(process, dirname, name))
708
718
goto errorReadingProcess;
888
898
process->showChildren = true;
902
void ProcessList_rebuildPanel(ProcessList* this, bool flags, int following, bool userOnly, uid_t userId, bool filtering, const char* incFilter) {
904
following = this->following;
905
userOnly = this->userOnly;
906
userId = this->userId;
907
filtering = this->filtering;
908
incFilter = this->incFilter;
910
this->following = following;
911
this->userOnly = userOnly;
912
this->userId = userId;
913
this->filtering = filtering;
914
this->incFilter = incFilter;
917
int currPos = Panel_getSelectedIndex(this->panel);
918
pid_t currPid = following ? following : 0;
919
int currScrollV = this->panel->scrollV;
921
Panel_prune(this->panel);
922
int size = ProcessList_size(this);
924
for (int i = 0; i < size; i++) {
926
Process* p = ProcessList_get(this, i);
929
|| (userOnly && (p->st_uid != userId))
930
|| (filtering && !(String_contains_i(p->comm, incFilter))) )
934
Panel_set(this->panel, idx, (Object*)p);
935
if ((following == -1 && idx == currPos) || (following != -1 && p->pid == currPid)) {
936
Panel_setSelected(this->panel, idx);
937
this->panel->scrollV = currScrollV;