diff options
author | Daniel Lange <DLange@git.local> | 2021-01-21 14:27:23 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2021-01-21 14:27:23 +0100 |
commit | 4531b31d92d23072fa978a3dedcbcab50c936188 (patch) | |
tree | 67d1e211d5d0c3d0d747bf7cd676a8a1cc040184 /Settings.c | |
parent | b20bb543ced602748d3d5fad191dda07919be13d (diff) |
Sort out the mess around column sorting that had accumulated over time
Diffstat (limited to 'Settings.c')
-rw-r--r-- | Settings.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } } |