diff options
author | Jakob Borg <jakob@nym.se> | 2016-05-12 08:23:18 +0000 |
---|---|---|
committer | Audrius Butkevicius <audrius.butkevicius@gmail.com> | 2016-05-12 08:23:18 +0000 |
commit | b993b418479411621a3ca16f29023ca234263ebd (patch) | |
tree | 117844755196dbee6a5205bcb54992d97f7004a6 | |
parent | 1be40cc4fabb54a2cc697f6638d81f7eb05a42c7 (diff) |
lib/config: Minor attribute updates
As discussed in
https://github.com/syncthing/docs/pull/169
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3082
-rw-r--r-- | lib/config/config_test.go | 4 | ||||
-rw-r--r-- | lib/config/folderconfiguration.go | 2 | ||||
-rw-r--r-- | lib/config/optionsconfiguration.go | 2 | ||||
-rwxr-xr-x | lib/config/testdata/overridenvalues.xml | 2 | ||||
-rw-r--r-- | lib/model/model.go | 2 | ||||
-rw-r--r-- | lib/model/model_test.go | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/lib/config/config_test.go b/lib/config/config_test.go index 1f5bce3971..1e4c3b9b46 100644 --- a/lib/config/config_test.go +++ b/lib/config/config_test.go @@ -59,7 +59,7 @@ func TestDefaultValues(t *testing.T) { URPostInsecurely: false, ReleasesURL: "https://api.github.com/repos/syncthing/syncthing/releases?per_page=30", AlwaysLocalNets: []string{}, - OverwriteNames: false, + OverwriteRemoteDevNames: false, TempIndexMinBlocks: 10, } @@ -188,7 +188,7 @@ func TestOverriddenValues(t *testing.T) { URPostInsecurely: true, ReleasesURL: "https://localhost/releases", AlwaysLocalNets: []string{}, - OverwriteNames: true, + OverwriteRemoteDevNames: true, TempIndexMinBlocks: 100, } diff --git a/lib/config/folderconfiguration.go b/lib/config/folderconfiguration.go index 4b85d870d0..75a984c6db 100644 --- a/lib/config/folderconfiguration.go +++ b/lib/config/folderconfiguration.go @@ -42,7 +42,7 @@ type FolderConfiguration struct { Invalid string `xml:"-" json:"invalid"` // Set at runtime when there is an error, not saved cachedPath string - DeprecatedReadOnly bool `xml:"ro,attr" json:"-"` + DeprecatedReadOnly bool `xml:"ro,attr,omitempty" json:"-"` } type FolderDeviceConfiguration struct { diff --git a/lib/config/optionsconfiguration.go b/lib/config/optionsconfiguration.go index 336423e645..ebeed6a072 100644 --- a/lib/config/optionsconfiguration.go +++ b/lib/config/optionsconfiguration.go @@ -37,7 +37,7 @@ type OptionsConfiguration struct { MinHomeDiskFreePct float64 `xml:"minHomeDiskFreePct" json:"minHomeDiskFreePct" default:"1"` ReleasesURL string `xml:"releasesURL" json:"releasesURL" default:"https://api.github.com/repos/syncthing/syncthing/releases?per_page=30"` AlwaysLocalNets []string `xml:"alwaysLocalNet" json:"alwaysLocalNets"` - OverwriteNames bool `xml:"overwriteNames" json:"overwriteNames" default:"false"` + OverwriteRemoteDevNames bool `xml:"overwriteRemoteDeviceNamesOnConnect" json:"overwriteRemoteDeviceNamesOnConnect" default:"false"` TempIndexMinBlocks int `xml:"tempIndexMinBlocks" json:"tempIndexMinBlocks" default:"10"` DeprecatedUPnPEnabled bool `xml:"upnpEnabled" json:"-"` diff --git a/lib/config/testdata/overridenvalues.xml b/lib/config/testdata/overridenvalues.xml index 59f3815b90..06fd7f9015 100755 --- a/lib/config/testdata/overridenvalues.xml +++ b/lib/config/testdata/overridenvalues.xml @@ -32,7 +32,7 @@ <urInitialDelayS>800</urInitialDelayS> <urPostInsecurely>true</urPostInsecurely> <releasesURL>https://localhost/releases</releasesURL> - <overwriteNames>true</overwriteNames> + <overwriteRemoteDeviceNamesOnConnect>true</overwriteRemoteDeviceNamesOnConnect> <tempIndexMinBlocks>100</tempIndexMinBlocks> </options> </configuration> diff --git a/lib/model/model.go b/lib/model/model.go index 3c7d82ebf4..5c3cae6543 100644 --- a/lib/model/model.go +++ b/lib/model/model.go @@ -1048,7 +1048,7 @@ func (m *Model) AddConnection(conn connections.Connection, hello protocol.HelloM m.pmut.Unlock() device, ok := m.cfg.Devices()[deviceID] - if ok && (device.Name == "" || m.cfg.Options().OverwriteNames) { + if ok && (device.Name == "" || m.cfg.Options().OverwriteRemoteDevNames) { device.Name = hello.DeviceName m.cfg.SetDevice(device) m.cfg.Save() diff --git a/lib/model/model_test.go b/lib/model/model_test.go index e08968b50f..a774a16bb6 100644 --- a/lib/model/model_test.go +++ b/lib/model/model_test.go @@ -386,7 +386,7 @@ func TestDeviceRename(t *testing.T) { m.Close(device1, protocol.ErrTimeout) opts := cfg.Options() - opts.OverwriteNames = true + opts.OverwriteRemoteDevNames = true cfg.SetOptions(opts) hello.DeviceName = "tester2" |