gui, lib/config: Add default path for new folders (fixes #2157)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4192
This commit is contained in:
Simon Frei
2017-07-20 13:16:54 +00:00
committed by Jakob Borg
parent 0ad10b0fee
commit a04b92332f
4 changed files with 47 additions and 12 deletions

View File

@@ -73,6 +73,7 @@ func TestDefaultValues(t *testing.T) {
KCPSendWindowSize: 128,
KCPUpdateIntervalMs: 25,
KCPFastResend: false,
DefaultFolderPath: "~",
}
cfg := New(device1)
@@ -221,6 +222,7 @@ func TestOverriddenValues(t *testing.T) {
KCPSendWindowSize: 1280,
KCPUpdateIntervalMs: 1000,
KCPFastResend: true,
DefaultFolderPath: "/media/syncthing",
}
os.Unsetenv("STNOUPGRADE")

View File

@@ -140,6 +140,7 @@ type OptionsConfiguration struct {
KCPCongestionControl bool `xml:"kcpCongestionControl" json:"kcpCongestionControl" default:"true"`
KCPSendWindowSize int `xml:"kcpSendWindowSize" json:"kcpSendWindowSize" default:"128"`
KCPReceiveWindowSize int `xml:"kcpReceiveWindowSize" json:"kcpReceiveWindowSize" default:"128"`
DefaultFolderPath string `xml:"defaultFolderPath" json:"defaultFolderPath" default:"~"`
DeprecatedUPnPEnabled bool `xml:"upnpEnabled,omitempty" json:"-"`
DeprecatedUPnPLeaseM int `xml:"upnpLeaseMinutes,omitempty" json:"-"`

View File

@@ -38,11 +38,12 @@
<stunKeepaliveSeconds>10</stunKeepaliveSeconds>
<stunServer>a.stun.com</stunServer>
<stunServer>b.stun.com</stunServer>
<defaultKCPEnabled>true</defaultKCPEnabled>
<kcpCongestionControl>false</kcpCongestionControl>
<kcpReceiveWindowSize>1280</kcpReceiveWindowSize>
<kcpSendWindowSize>1280</kcpSendWindowSize>
<kcpUpdateIntervalMs>1000</kcpUpdateIntervalMs>
<kcpFastResend>true</kcpFastResend>
<defaultKCPEnabled>true</defaultKCPEnabled>
<kcpCongestionControl>false</kcpCongestionControl>
<kcpReceiveWindowSize>1280</kcpReceiveWindowSize>
<kcpSendWindowSize>1280</kcpSendWindowSize>
<kcpUpdateIntervalMs>1000</kcpUpdateIntervalMs>
<kcpFastResend>true</kcpFastResend>
<defaultFolderPath>/media/syncthing</defaultFolderPath>
</options>
</configuration>