lib/model: Use factories for creating folders
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3029
This commit is contained in:
committed by
Jakob Borg
parent
6720906ee5
commit
eabd2fc936
@@ -23,6 +23,9 @@ const (
|
||||
OldestHandledVersion = 10
|
||||
CurrentVersion = 13
|
||||
MaxRescanIntervalS = 365 * 24 * 60 * 60
|
||||
|
||||
FolderTypeReadWrite = "readwrite"
|
||||
FolderTypeReadOnly = "readonly"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -247,6 +250,15 @@ func convertV12V13(cfg *Configuration) {
|
||||
cfg.Options.NATRenewalM = cfg.Options.DeprecatedUPnPRenewalM
|
||||
cfg.Options.NATTimeoutS = cfg.Options.DeprecatedUPnPTimeoutS
|
||||
cfg.Version = 13
|
||||
|
||||
for i, fcfg := range cfg.Folders {
|
||||
if fcfg.DeprecatedReadOnly {
|
||||
cfg.Folders[i].Type = FolderTypeReadOnly
|
||||
} else {
|
||||
cfg.Folders[i].Type = FolderTypeReadWrite
|
||||
}
|
||||
cfg.Folders[i].DeprecatedReadOnly = false
|
||||
}
|
||||
}
|
||||
|
||||
func convertV11V12(cfg *Configuration) {
|
||||
|
||||
Reference in New Issue
Block a user