summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2020-12-08 21:24:19 +0100
committerBenny Baumann <BenBE@geshi.org>2020-12-08 21:24:19 +0100
commitf6613db5cdd04aa5e3f2ad3f19351a06a60808c5 (patch)
tree1951791a9983a151042fb946bc087b07b7f7bc1a
parent4c44a70f96d1cc826d5388bea33d542273d066af (diff)
Additional code simplification
Additional correction for #375
-rw-r--r--Process.c3
-rw-r--r--ProcessList.c15
-rw-r--r--linux/LinuxProcess.c3
3 files changed, 10 insertions, 11 deletions
diff --git a/Process.c b/Process.c
index 4581497a..170e1486 100644
--- a/Process.c
+++ b/Process.c
@@ -318,7 +318,8 @@ void Process_writeField(const Process* this, RichString* str, ProcessField field
buf += written;
n -= written;
}
- const char* draw = CRT_treeStr[lastItem ? (this->settings->direction == 1 ? TREE_STR_BEND : TREE_STR_BEND) : TREE_STR_RTEE];
+
+ const char* draw = CRT_treeStr[lastItem ? TREE_STR_BEND : TREE_STR_RTEE];
xSnprintf(buf, n, "%s%s ", draw, this->showChildren ? CRT_treeStr[TREE_STR_SHUT] : CRT_treeStr[TREE_STR_OPEN] );
RichString_appendWide(str, CRT_colors[PROCESS_TREE], buffer);
Process_writeCommand(this, attr, baseattr, str);
diff --git a/ProcessList.c b/ProcessList.c
index dc8f62cb..a12e8534 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -479,23 +479,20 @@ void ProcessList_rebuildPanel(ProcessList* this) {
int size = ProcessList_size(this);
int idx = 0;
for (int i = 0; i < size; i++) {
- bool hidden = false;
Process* p = ProcessList_get(this, i);
if ( (!p->show)
|| (this->userId != (uid_t) -1 && (p->st_uid != this->userId))
|| (incFilter && !(String_contains_i(Process_getCommand(p), incFilter)))
|| (this->pidMatchList && !Hashtable_get(this->pidMatchList, p->tgid)) )
- hidden = true;
+ continue;
- if (!hidden) {
- Panel_set(this->panel, idx, (Object*)p);
- if ((this->following == -1 && idx == currPos) || (this->following != -1 && p->pid == currPid)) {
- Panel_setSelected(this->panel, idx);
- this->panel->scrollV = currScrollV;
- }
- idx++;
+ Panel_set(this->panel, idx, (Object*)p);
+ if ((this->following == -1 && idx == currPos) || (this->following != -1 && p->pid == currPid)) {
+ Panel_setSelected(this->panel, idx);
+ this->panel->scrollV = currScrollV;
}
+ idx++;
}
}
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c
index 05626065..ef155af8 100644
--- a/linux/LinuxProcess.c
+++ b/linux/LinuxProcess.c
@@ -605,8 +605,9 @@ static void LinuxProcess_writeCommandField(const Process *this, RichString *str,
buf = stpcpy(buf, " ");
}
}
+
n -= (buf - buffer);
- const char* draw = CRT_treeStr[lastItem ? (this->settings->direction == 1 ? TREE_STR_BEND : TREE_STR_TEND) : TREE_STR_RTEE];
+ const char* draw = CRT_treeStr[lastItem ? TREE_STR_BEND : TREE_STR_RTEE];
xSnprintf(buf, n, "%s%s ", draw, this->showChildren ? CRT_treeStr[TREE_STR_SHUT] : CRT_treeStr[TREE_STR_OPEN] );
RichString_appendWide(str, CRT_colors[PROCESS_TREE], buffer);
LinuxProcess_writeCommand(this, attr, baseattr, str);

© 2014-2024 Faster IT GmbH | imprint | privacy policy