lib/model: Emit LocalDiskUpdated events on detecting local changes

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3055
This commit is contained in:
Nate Morrison
2016-05-14 08:37:07 +00:00
committed by Jakob Borg
parent 5d2414dfa9
commit 5a7fad0bcd
7 changed files with 85 additions and 15 deletions

View File

@@ -62,7 +62,7 @@ func setUpModel(file protocol.FileInfo) *Model {
model := NewModel(defaultConfig, protocol.LocalDeviceID, "device", "syncthing", "dev", db, nil)
model.AddFolder(defaultFolderConfig)
// Update index
model.updateLocals("default", []protocol.FileInfo{file})
model.updateLocalsFromPulling("default", []protocol.FileInfo{file})
return model
}
@@ -255,7 +255,7 @@ func TestCopierCleanup(t *testing.T) {
file.Blocks = []protocol.BlockInfo{blocks[1]}
file.Version = file.Version.Update(protocol.LocalDeviceID.Short())
// Update index (removing old blocks)
m.updateLocals("default", []protocol.FileInfo{file})
m.updateLocalsFromPulling("default", []protocol.FileInfo{file})
if m.finder.Iterate(folders, blocks[0].Hash, iterFn) {
t.Error("Unexpected block found")
@@ -268,7 +268,7 @@ func TestCopierCleanup(t *testing.T) {
file.Blocks = []protocol.BlockInfo{blocks[0]}
file.Version = file.Version.Update(protocol.LocalDeviceID.Short())
// Update index (removing old blocks)
m.updateLocals("default", []protocol.FileInfo{file})
m.updateLocalsFromPulling("default", []protocol.FileInfo{file})
if !m.finder.Iterate(folders, blocks[0].Hash, iterFn) {
t.Error("Unexpected block found")