From e93689092706fbad751dab5658feb303319b093e Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 22 Jun 2015 11:27:44 +0200 Subject: [PATCH] Don't rename duplicate folders (fixes #1675) Renaming them puts the user in a difficult situation as they can't rename them back in the GUI. This way, they need to fix the config in the same way it got broken (manual editing or external tool). --- internal/config/config.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 7611dedee..0fd9cf03a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -9,7 +9,6 @@ package config import ( "encoding/xml" - "fmt" "io" "math/rand" "os" @@ -310,7 +309,6 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) { // Check for missing, bad or duplicate folder ID:s var seenFolders = map[string]*FolderConfiguration{} - var uniqueCounter int for i := range cfg.Folders { folder := &cfg.Folders[i] @@ -339,15 +337,8 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) { if seen, ok := seenFolders[folder.ID]; ok { l.Warnf("Multiple folders with ID %q; disabling", folder.ID) - seen.Invalid = "duplicate folder ID" - if seen.ID == folder.ID { - uniqueCounter++ - seen.ID = fmt.Sprintf("%s~%d", folder.ID, uniqueCounter) - } folder.Invalid = "duplicate folder ID" - uniqueCounter++ - folder.ID = fmt.Sprintf("%s~%d", folder.ID, uniqueCounter) } else { seenFolders[folder.ID] = folder }