lib/model: Remove unused func (#6456)

This commit is contained in:
Simon Frei 2020-03-26 14:19:26 +01:00 committed by GitHub
parent 963e9a4071
commit b7dffc051e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2562,30 +2562,6 @@ func (m *model) checkFolderRunningLocked(folder string) error {
return errFolderNotRunning
}
// checkFolderDeviceStatusLocked first checks the folder and then whether the
// given device is connected and shares this folder.
// Need to hold (read) lock on both m.fmut and m.pmut when calling this.
func (m *model) checkDeviceFolderConnectedLocked(device protocol.DeviceID, folder string) error {
if err := m.checkFolderRunningLocked(folder); err != nil {
return err
}
if cfg, ok := m.cfg.Device(device); !ok {
return errDeviceUnknown
} else if cfg.Paused {
return errDevicePaused
}
if _, ok := m.conn[device]; !ok {
return errors.New("device is not connected")
}
if cfg, ok := m.cfg.Folder(folder); !ok || !cfg.SharedWith(device) {
return errors.New("folder is not shared with device")
}
return nil
}
// mapFolders returns a map of folder ID to folder configuration for the given
// slice of folder configurations.
func mapFolders(folders []config.FolderConfiguration) map[string]config.FolderConfiguration {