lib/model: Remove syncthing-specific files (fixes #3819)

Syncthing adds some hidden files when a folder is added, but there is currently
no equivalent cleanup procedure. This change is conservative as not to
accidentally cause data loss.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3874
This commit is contained in:
Adel Qalieh 2017-01-07 17:05:30 +00:00 committed by Jakob Borg
parent fe377a166a
commit 8d2a31e38e
1 changed files with 5 additions and 0 deletions

View File

@ -330,6 +330,11 @@ func (m *Model) RemoveFolder(folder string) {
m.fmut.Lock()
m.pmut.Lock()
// Delete syncthing specific files
folderCfg := m.folderCfgs[folder]
folderPath := folderCfg.Path()
os.Remove(filepath.Join(folderPath, ".stfolder"))
m.tearDownFolderLocked(folder)
// Remove it from the database
db.DropFolder(m.db, folder)