lib, gui: Default ignores for new folders (fixes #7428) (#7530)

This commit is contained in:
Simon Frei
2022-01-13 23:38:21 +01:00
committed by GitHub
parent 40bb52fdd8
commit 21d04b895a
17 changed files with 718 additions and 218 deletions
+8
View File
@@ -100,6 +100,7 @@ type Wrapper interface {
GUI() GUIConfiguration
LDAP() LDAPConfiguration
Options() OptionsConfiguration
DefaultIgnores() Ignores
Folder(id string) (FolderConfiguration, bool)
Folders() map[string]FolderConfiguration
@@ -437,6 +438,13 @@ func (w *wrapper) GUI() GUIConfiguration {
return w.cfg.GUI.Copy()
}
// DefaultIgnores returns the list of ignore patterns to be used by default on folders.
func (w *wrapper) DefaultIgnores() Ignores {
w.mut.Lock()
defer w.mut.Unlock()
return w.cfg.Defaults.Ignores.Copy()
}
// IgnoredDevice returns whether or not connection attempts from the given
// device should be silently ignored.
func (w *wrapper) IgnoredDevice(id protocol.DeviceID) bool {