diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-08-24 16:23:20 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-08-24 18:39:00 -0300 |
commit | 0939e5cb4139a873f4338a4a9d497e6b38181ca4 (patch) | |
tree | a86654dfb4d24ba92ab4321ea055c55f6458c949 | |
parent | e1c2dc56fd2e4c9bd58d1ede0fd0a8698f091e67 (diff) |
Settings: fix default and storage of sort keys
-rw-r--r-- | Settings.c | 5 | ||||
-rw-r--r-- | linux/Platform.c | 2 |
2 files changed, 5 insertions, 2 deletions
@@ -216,6 +216,9 @@ static void Settings_defaultMeters(Settings* this) { } static const char* toFieldName(int i) { + if (i < 0 || i > LAST_PROCESSFIELD) { + return ""; + } return Process_fields[i].name; } @@ -275,7 +278,7 @@ static void Settings_defaultScreens(Settings* this) { for (unsigned int i = 0; i < Platform_numberOfDefaultScreens; i++) { ScreenDefaults* defaults = &Platform_defaultScreens[i]; Settings_newScreen(this, defaults->name, defaults->columns); - this->screens[0]->sortKey = toFieldIndex(defaults->sortKey); + this->screens[i]->sortKey = toFieldIndex(defaults->sortKey); } } diff --git a/linux/Platform.c b/linux/Platform.c index 7efc7e47..cfaa0f14 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -101,7 +101,7 @@ ScreenDefaults Platform_defaultScreens[] = { { .name = "L1 Data Cache", .columns = "PID USER PERCENT_CPU L1DREADS L1DRMISSES L1DWRITES L1DWMISSES Command", - .sortKey = "LD1READS", + .sortKey = "L1DREADS", }, }; |