all: Add configurable defaults (fixes #4224, fixes #6086) (#7131)

This commit is contained in:
Simon Frei
2021-02-04 21:10:41 +01:00
committed by GitHub
parent 31119ed61a
commit ffc14a77c6
41 changed files with 1708 additions and 1046 deletions
+6 -1
View File
@@ -52,7 +52,12 @@ func DefaultConfig(path string, myID protocol.DeviceID, evLogger events.Logger,
return config.Wrap(path, newCfg, myID, evLogger), nil
}
newCfg.Folders = append(newCfg.Folders, config.NewFolderConfiguration(myID, "default", "Default Folder", fs.FilesystemTypeBasic, locations.Get(locations.DefFolder)))
fcfg := newCfg.Defaults.Folder.Copy()
fcfg.ID = "default"
fcfg.Label = "Default Folder"
fcfg.FilesystemType = fs.FilesystemTypeBasic
fcfg.Path = locations.Get(locations.DefFolder)
newCfg.Folders = append(newCfg.Folders, fcfg)
l.Infoln("Default folder created and/or linked to new config")
return config.Wrap(path, newCfg, myID, evLogger), nil
}