1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

WTF-400 Fix missed wtf.Config occurrances

This commit is contained in:
Chris Cummer
2019-04-16 21:47:51 -07:00
parent 6f98ecccf7
commit 2807a2200e
7 changed files with 16 additions and 18 deletions

View File

@@ -3,16 +3,14 @@ package clocks
import (
"sort"
"time"
"github.com/wtfutil/wtf/wtf"
)
type ClockCollection struct {
Clocks []Clock
}
func (clocks *ClockCollection) Sorted() []Clock {
if "chronological" == wtf.Config.UString("wtf.mods.clocks.sort", "alphabetical") {
func (clocks *ClockCollection) Sorted(sortOrder string) []Clock {
if sortOrder == "chronological" {
clocks.SortedChronologically()
} else {
clocks.SortedAlphabetically()

View File

@@ -34,7 +34,7 @@ func NewWidget(app *tview.Application, settings *Settings) *Widget {
/* -------------------- Exported Functions -------------------- */
func (widget *Widget) Refresh() {
widget.display(widget.clockColl.Sorted(), widget.dateFormat, widget.timeFormat)
widget.display(widget.clockColl.Sorted(widget.settings.sort), widget.dateFormat, widget.timeFormat)
}
/* -------------------- Unexported Functions -------------------- */