lib/model: Clarify master terminology (fixes #2679)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3793
This commit is contained in:
committed by
Audrius Butkevicius
parent
542b76f687
commit
398c356f22
@@ -407,9 +407,9 @@ func convertV13V14(cfg *Configuration) {
|
||||
|
||||
for i, fcfg := range cfg.Folders {
|
||||
if fcfg.DeprecatedReadOnly {
|
||||
cfg.Folders[i].Type = FolderTypeReadOnly
|
||||
cfg.Folders[i].Type = FolderTypeSendOnly
|
||||
} else {
|
||||
cfg.Folders[i].Type = FolderTypeReadWrite
|
||||
cfg.Folders[i].Type = FolderTypeSendReceive
|
||||
}
|
||||
cfg.Folders[i].DeprecatedReadOnly = false
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ func TestDeviceConfig(t *testing.T) {
|
||||
ID: "test",
|
||||
RawPath: "testdata",
|
||||
Devices: []FolderDeviceConfiguration{{DeviceID: device1}, {DeviceID: device4}},
|
||||
Type: FolderTypeReadOnly,
|
||||
Type: FolderTypeSendOnly,
|
||||
RescanIntervalS: 600,
|
||||
Copiers: 0,
|
||||
Pullers: 0,
|
||||
|
||||
@@ -9,15 +9,15 @@ package config
|
||||
type FolderType int
|
||||
|
||||
const (
|
||||
FolderTypeReadWrite FolderType = iota // default is readwrite
|
||||
FolderTypeReadOnly
|
||||
FolderTypeSendReceive FolderType = iota // default is sendreceive
|
||||
FolderTypeSendOnly
|
||||
)
|
||||
|
||||
func (t FolderType) String() string {
|
||||
switch t {
|
||||
case FolderTypeReadWrite:
|
||||
case FolderTypeSendReceive:
|
||||
return "readwrite"
|
||||
case FolderTypeReadOnly:
|
||||
case FolderTypeSendOnly:
|
||||
return "readonly"
|
||||
default:
|
||||
return "unknown"
|
||||
@@ -30,12 +30,12 @@ func (t FolderType) MarshalText() ([]byte, error) {
|
||||
|
||||
func (t *FolderType) UnmarshalText(bs []byte) error {
|
||||
switch string(bs) {
|
||||
case "readwrite":
|
||||
*t = FolderTypeReadWrite
|
||||
case "readonly":
|
||||
*t = FolderTypeReadOnly
|
||||
case "readwrite", "sendreceive":
|
||||
*t = FolderTypeSendReceive
|
||||
case "readonly", "sendonly":
|
||||
*t = FolderTypeSendOnly
|
||||
default:
|
||||
*t = FolderTypeReadWrite
|
||||
*t = FolderTypeSendReceive
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user