dropDeleteSourceSync handles delete source event for DropMove case, for Sync
(de *events.DragDrop)
| 485 | |
| 486 | // dropDeleteSourceSync handles delete source event for DropMove case, for Sync |
| 487 | func (tr *Tree) dropDeleteSourceSync(de *events.DragDrop) { |
| 488 | md := de.Data.(mimedata.Mimes) |
| 489 | sroot := tr.root.SyncNode |
| 490 | for _, d := range md { |
| 491 | if d.Type != fileinfo.TextPlain { // link |
| 492 | continue |
| 493 | } |
| 494 | path := string(d.Data) |
| 495 | sn := sroot.AsTree().FindPath(path) |
| 496 | if sn != nil { |
| 497 | sn.AsTree().Delete() |
| 498 | } |
| 499 | sn = sroot.AsTree().FindPath(path + treeTempMovedTag) |
| 500 | if sn != nil { |
| 501 | psplt := strings.Split(path, "/") |
| 502 | orgnm := psplt[len(psplt)-1] |
| 503 | sn.AsTree().SetName(orgnm) |
| 504 | AsWidget(sn).NeedsRender() |
| 505 | } |
| 506 | } |
| 507 | tr.sendChangeEventReSync(nil) |
| 508 | } |
no test coverage detected