From ed005f770c9976877fa4838616a386a2501503f2 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Tue, 7 Jun 2022 15:22:26 -0500 Subject: dirlist: fix ruestring counts from checkmail Commit 8b6f971 broke ruestring counts when AccurateCounts=true, which primarily occur from a checkmail. This restores the functionality. Signed-off-by: Tim Culverhouse Acked-by: Robin Jarry --- widgets/dirlist.go | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'widgets') diff --git a/widgets/dirlist.go b/widgets/dirlist.go index 2c761a5c..2168e198 100644 --- a/widgets/dirlist.go +++ b/widgets/dirlist.go @@ -249,20 +249,17 @@ func (dirlist *DirectoryList) getRUEString(name string) string { if !ok { return "" } - var totalRecent, totalUnseen, totalExists int if !msgStore.DirInfo.AccurateCounts { - totalRecent, totalUnseen = countRUE(msgStore) - msgStore.DirInfo.Recent = totalRecent - msgStore.DirInfo.Unseen = totalUnseen + msgStore.DirInfo.Recent, msgStore.DirInfo.Unseen = countRUE(msgStore) } - totalExists = msgStore.DirInfo.Exists + di := msgStore.DirInfo rueString := "" - if totalRecent > 0 { - rueString = fmt.Sprintf("%d/%d/%d", totalRecent, totalUnseen, totalExists) - } else if totalUnseen > 0 { - rueString = fmt.Sprintf("%d/%d", totalUnseen, totalExists) - } else if totalExists > 0 { - rueString = fmt.Sprintf("%d", totalExists) + if di.Recent > 0 { + rueString = fmt.Sprintf("%d/%d/%d", di.Recent, di.Unseen, di.Exists) + } else if di.Unseen > 0 { + rueString = fmt.Sprintf("%d/%d", di.Unseen, di.Exists) + } else if di.Exists > 0 { + rueString = fmt.Sprintf("%d", di.Exists) } return rueString } -- cgit