File tree Expand file tree Collapse file tree 2 files changed +11
-20
lines changed
Expand file tree Collapse file tree 2 files changed +11
-20
lines changed Original file line number Diff line number Diff line change @@ -479,5 +479,15 @@ func (entry *Entry) MIMEType() string {
479479}
480480
481481func (entry * Entry ) Remove () error {
482- return entry .Folder .deleteAndDeselectLocalFile (entry .Path ())
482+ path := entry .Path ()
483+ err := entry .Folder .deleteLocalFileAndRedundantChildren (path )
484+ if err != nil {
485+ return err
486+ }
487+ containingDir := filepath .Dir (path )
488+ return entry .Folder .RescanSubdirectory (containingDir )
489+ // In selective folders, the entry will remain selected until the app cleans the entry in .stignore up.
490+ // It would be better to also deselect the file immediately after the deletion has been picked up by Syncthing,
491+ // but there appears not to be a reliable way to do this. Hence deleted files may become unintentionally selected
492+ // again if another peer re-adds them.
483493}
Original file line number Diff line number Diff line change @@ -964,25 +964,6 @@ func (fld *Folder) deleteLocalFileAndRedundantChildren(path string) error {
964964 return nil
965965}
966966
967- func (fld * Folder ) deleteAndDeselectLocalFile (path string ) error {
968- err := fld .deleteLocalFileAndRedundantChildren (path )
969- if err != nil {
970- return err
971- }
972-
973- err = fld .client .app .Internals .ScanFolderSubdirs (fld .FolderID , []string {path })
974- if err != nil {
975- return err
976- }
977-
978- err = fld .SetLocalFileExplicitlySelected (path , false )
979- if err != nil {
980- return err
981- }
982-
983- return nil
984- }
985-
986967func (fld * Folder ) reloadIgnores () error {
987968 if ! fld .IsPaused () {
988969 err := fld .SetPaused (true )
You can’t perform that action at this time.
0 commit comments