DropDeleteSource handles delete source event for DropMove case
(e events.Event)
| 1548 | |
| 1549 | // DropDeleteSource handles delete source event for DropMove case |
| 1550 | func (tr *Tree) DropDeleteSource(e events.Event) { |
| 1551 | de := e.(*events.DragDrop) |
| 1552 | tr.UnselectAll() |
| 1553 | if tr.SyncNode != nil { |
| 1554 | tr.dropDeleteSourceSync(de) |
| 1555 | return |
| 1556 | } |
| 1557 | md := de.Data.(mimedata.Mimes) |
| 1558 | root := tr.root |
| 1559 | for _, d := range md { |
| 1560 | if d.Type != fileinfo.TextPlain { // link |
| 1561 | continue |
| 1562 | } |
| 1563 | path := string(d.Data) |
| 1564 | sn := root.FindPath(path) |
| 1565 | if sn != nil { |
| 1566 | sn.AsTree().Delete() |
| 1567 | } |
| 1568 | sn = root.FindPath(path + treeTempMovedTag) |
| 1569 | if sn != nil { |
| 1570 | psplt := strings.Split(path, "/") |
| 1571 | orgnm := psplt[len(psplt)-1] |
| 1572 | sn.AsTree().SetName(orgnm) |
| 1573 | AsWidget(sn).NeedsRender() |
| 1574 | } |
| 1575 | } |
| 1576 | } |
nothing calls this directly
no test coverage detected