mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-07 00:53:58 +00:00
lib/config, lib/protocol: Improve folder description with empty label
This commit is contained in:
parent
f09698d845
commit
2f770f8bfb
@ -106,6 +106,9 @@ func (f *FolderConfiguration) HasMarker() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f FolderConfiguration) Description() string {
|
func (f FolderConfiguration) Description() string {
|
||||||
|
if f.Label == "" {
|
||||||
|
return f.ID
|
||||||
|
}
|
||||||
return fmt.Sprintf("%q (%s)", f.Label, f.ID)
|
return fmt.Sprintf("%q (%s)", f.Label, f.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,9 +184,10 @@ func (m *Model) StartDeadlockDetector(timeout time.Duration) {
|
|||||||
func (m *Model) StartFolder(folder string) {
|
func (m *Model) StartFolder(folder string) {
|
||||||
m.fmut.Lock()
|
m.fmut.Lock()
|
||||||
folderType := m.startFolderLocked(folder)
|
folderType := m.startFolderLocked(folder)
|
||||||
|
folderCfg := m.folderCfgs[folder]
|
||||||
m.fmut.Unlock()
|
m.fmut.Unlock()
|
||||||
|
|
||||||
l.Infoln("Ready to synchronize", folder, fmt.Sprintf("(%s)", folderType))
|
l.Infof("Ready to synchronize %s (%s)", folderCfg.Description(), folderType)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Model) startFolderLocked(folder string) config.FolderType {
|
func (m *Model) startFolderLocked(folder string) config.FolderType {
|
||||||
|
@ -148,5 +148,8 @@ func NewIndexID() IndexID {
|
|||||||
|
|
||||||
func (f Folder) Description() string {
|
func (f Folder) Description() string {
|
||||||
// used by logging stuff
|
// used by logging stuff
|
||||||
|
if f.Label == "" {
|
||||||
|
return f.ID
|
||||||
|
}
|
||||||
return fmt.Sprintf("%q (%s)", f.Label, f.ID)
|
return fmt.Sprintf("%q (%s)", f.Label, f.ID)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user