dirtree: fix build errors

Fix the following errors:

widgets/dirtree.go:401:18: not enough arguments in call to dt.UiConfig
	have ()
	want (string) (typecheck)
		if dt.UiConfig().DirListCollapse != 0 {
		              ^
widgets/dirtree.go:402:38: not enough arguments in call to dt.UiConfig
	have ()
	want (string) (typecheck)
			node.Hidden = depth > dt.UiConfig().DirListCollapse
			                                 ^
Since commit e0b62db583c3 ("fix: Set proper UIConfig for msgstores"),
DirectoryTree.UiConfig() takes a path parameter.

Fixes: db39ca181a ("dirtree: add dirtree-collapse config setting")
Signed-off-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Robin Jarry 2022-08-22 09:53:56 +02:00
parent 62ac7a5071
commit d138da0c9f

View file

@ -386,6 +386,7 @@ func (dt *DirectoryTree) buildTreeNode(node *types.Thread, stree [][]string, def
keys = append(keys, key)
}
sort.Strings(keys)
path := dt.getDirectory(node)
for _, key := range keys {
next := m[key]
var uid uint32 = defaultUid
@ -398,8 +399,8 @@ func (dt *DirectoryTree) buildTreeNode(node *types.Thread, stree [][]string, def
}
nextNode := &types.Thread{Uid: uid}
node.AddChild(nextNode)
if dt.UiConfig().DirListCollapse != 0 {
node.Hidden = depth > dt.UiConfig().DirListCollapse
if dt.UiConfig(path).DirListCollapse != 0 {
node.Hidden = depth > dt.UiConfig(path).DirListCollapse
}
dt.buildTreeNode(nextNode, next, defaultUid, depth+1)
}