mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-08 23:08:27 +00:00
Don't show restart prompt when changing folder label (fixes #2840)
This commit is contained in:
parent
d8fba47870
commit
17517bcc3d
@ -209,10 +209,14 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) {
|
|||||||
// Ensure that any loose devices are not present in the wrong places
|
// Ensure that any loose devices are not present in the wrong places
|
||||||
// Ensure that there are no duplicate devices
|
// Ensure that there are no duplicate devices
|
||||||
// Ensure that puller settings are sane
|
// Ensure that puller settings are sane
|
||||||
|
// Ensure that the versioning configuration parameter map is not nil
|
||||||
for i := range cfg.Folders {
|
for i := range cfg.Folders {
|
||||||
cfg.Folders[i].Devices = ensureDevicePresent(cfg.Folders[i].Devices, myID)
|
cfg.Folders[i].Devices = ensureDevicePresent(cfg.Folders[i].Devices, myID)
|
||||||
cfg.Folders[i].Devices = ensureExistingDevices(cfg.Folders[i].Devices, existingDevices)
|
cfg.Folders[i].Devices = ensureExistingDevices(cfg.Folders[i].Devices, existingDevices)
|
||||||
cfg.Folders[i].Devices = ensureNoDuplicateFolderDevices(cfg.Folders[i].Devices)
|
cfg.Folders[i].Devices = ensureNoDuplicateFolderDevices(cfg.Folders[i].Devices)
|
||||||
|
if cfg.Folders[i].Versioning.Params == nil {
|
||||||
|
cfg.Folders[i].Versioning.Params = map[string]string{}
|
||||||
|
}
|
||||||
sort.Sort(FolderDeviceConfigurationList(cfg.Folders[i].Devices))
|
sort.Sort(FolderDeviceConfigurationList(cfg.Folders[i].Devices))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1942,9 +1942,11 @@ func (m *Model) CommitConfiguration(from, to config.Configuration) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if anything else differs, apart from the device list.
|
// Check if anything else differs, apart from the device list and label.
|
||||||
fromCfg.Devices = nil
|
fromCfg.Devices = nil
|
||||||
toCfg.Devices = nil
|
toCfg.Devices = nil
|
||||||
|
fromCfg.Label = ""
|
||||||
|
toCfg.Label = ""
|
||||||
if !reflect.DeepEqual(fromCfg, toCfg) {
|
if !reflect.DeepEqual(fromCfg, toCfg) {
|
||||||
l.Debugln(m, "requires restart, folder", folderID, "configuration differs")
|
l.Debugln(m, "requires restart, folder", folderID, "configuration differs")
|
||||||
return false
|
return false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user