MCPcopy Create free account
hub / github.com/cogentcore/core / setSortBy

Method setSortBy

filetree/dir.go:88–100  ·  view source on GitHub ↗

setSortBy sets the given directory's sort by option

(path string, modTime bool)

Source from the content-addressed store, hash-verified

86
87// setSortBy sets the given directory's sort by option
88func (dm *DirFlagMap) setSortBy(path string, modTime bool) {
89 dm.init()
90 defer dm.mu.Unlock()
91 df := dm.Map[path]
92 if modTime {
93 df.SetFlag(true, dirSortByModTime)
94 df.SetFlag(false, dirSortByName)
95 } else {
96 df.SetFlag(false, dirSortByModTime)
97 df.SetFlag(true, dirSortByName)
98 }
99 dm.Map[path] = df
100}

Callers 1

setDirSortByMethod · 0.80

Calls 3

initMethod · 0.95
UnlockMethod · 0.65
SetFlagMethod · 0.65

Tested by

no test coverage detected