Sort out the mess around column sorting that had accumulated over time

This commit is contained in:
Daniel Lange
2021-01-21 14:27:23 +01:00
parent b20bb543ce
commit 4531b31d92
11 changed files with 102 additions and 93 deletions

View File

@ -330,7 +330,7 @@ Settings* Settings_new(int initialCpuCount) {
this->sortKey = PERCENT_CPU;
this->treeSortKey = PID;
this->direction = 1;
this->direction = -1;
this->treeDirection = 1;
this->shadowOtherUsers = false;
this->showThreadNames = false;
@ -450,10 +450,10 @@ void Settings_invertSortOrder(Settings* this) {
void Settings_setSortKey(Settings* this, ProcessField sortKey) {
if (this->treeViewAlwaysByPID || !this->treeView) {
this->sortKey = sortKey;
this->direction = 1;
this->direction = (Process_fields[sortKey].defaultSortDesc) ? -1 : 1;
this->treeView = false;
} else {
this->treeSortKey = sortKey;
this->treeDirection = 1;
this->treeDirection = (Process_fields[sortKey].defaultSortDesc) ? -1 : 1;
}
}