update config with get, gettoggle methods

This commit is contained in:
Bradley Cicenas
2017-02-12 06:03:10 +00:00
parent d5d91398f5
commit d56af1d932
6 changed files with 51 additions and 30 deletions

View File

@@ -31,8 +31,8 @@ type Containers []*Container
func (a Containers) Len() int { return len(a) }
func (a Containers) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a Containers) Less(i, j int) bool {
f := Sorters[config.Global["sortField"]]
if config.Global["sortReversed"] == "1" {
f := Sorters[config.Get("sortField")]
if config.GetToggle("sortReversed") {
return f(a[j], a[i])
}
return f(a[i], a[j])