From 4531b31d92d23072fa978a3dedcbcab50c936188 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Thu, 21 Jan 2021 14:27:23 +0100 Subject: Sort out the mess around column sorting that had accumulated over time --- Settings.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Settings.c') diff --git a/Settings.c b/Settings.c index f252c10d..93e56f97 100644 --- a/Settings.c +++ b/Settings.c @@ -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; } } -- cgit v1.2.3