summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2014-06-17 23:22:19 +0200
committerJakob Borg <jakob@nym.se>2014-06-18 12:54:30 +0200
commitb05fcbc9d72dda356989bad150ada80b690bea64 (patch)
tree839fbf711739859cd64486e238ae643a08cadbe6 /config
parentd09c71b688e618c5af438138363b501ea7171dfa (diff)
Simplify usage reporting config options (fixes #370)
Diffstat (limited to 'config')
-rw-r--r--config/config.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/config/config.go b/config/config.go
index 2868192696..77c86d4783 100644
--- a/config/config.go
+++ b/config/config.go
@@ -16,9 +16,9 @@ import (
"strconv"
"strings"
- "github.com/calmh/syncthing/scanner"
"code.google.com/p/go.crypto/bcrypt"
"github.com/calmh/syncthing/logger"
+ "github.com/calmh/syncthing/scanner"
)
var l = logger.DefaultLogger
@@ -156,11 +156,10 @@ type OptionsConfiguration struct {
MaxChangeKbps int `xml:"maxChangeKbps" default:"10000"`
StartBrowser bool `xml:"startBrowser" default:"true"`
UPnPEnabled bool `xml:"upnpEnabled" default:"true"`
+ URAccepted int `xml:"urAccepted"` // Accepted usage reporting version; 0 for off (undecided), -1 for off (permanently)
- UREnabled bool `xml:"urEnabled"` // If true, send usage reporting data
- URDeclined bool `xml:"urDeclined"` // If true, don't ask again
- URAccepted int `xml:"urAccepted"` // Accepted usage reporting version
-
+ Deprecated_UREnabled bool `xml:"urEnabled,omitempty" json:"-"`
+ Deprecated_URDeclined bool `xml:"urDeclined,omitempty" json:"-"`
Deprecated_ReadOnly bool `xml:"readOnly,omitempty" json:"-"`
Deprecated_GUIEnabled bool `xml:"guiEnabled,omitempty" json:"-"`
Deprecated_GUIAddress string `xml:"guiAddress,omitempty" json:"-"`
@@ -345,6 +344,12 @@ func Load(rd io.Reader, myID string) (Configuration, error) {
}
}
+ if cfg.Options.Deprecated_URDeclined {
+ cfg.Options.URAccepted = -1
+ }
+ cfg.Options.Deprecated_URDeclined = false
+ cfg.Options.Deprecated_UREnabled = false
+
// Upgrade to v2 configuration if appropriate
if cfg.Version == 1 {
convertV1V2(&cfg)