MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / OnFileItemDrop

Method OnFileItemDrop

src/Windows/FTPWindow.cpp:991–1016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

989}
990
991int FTPWindow::OnFileItemDrop(FileObject* item, FileObject* parent, bool bIsMove)
992{
993 if (item == NULL || parent == NULL) return false;
994
995 int ret = -1;
996 if (parent->GetChildByName(item->GetName()) != NULL) {
997 MessageDialog md;
998
999 int res = md.Create(m_hwnd, TEXT("Target item exists"), TEXT("Are you sure you want to overwrite existing item?"));
1000 if (res != 1) {
1001 TreeView_SetItemState(m_treeview.GetHWND(), (HTREEITEM)m_currentDragObject->GetData(), ~TVIS_CUT, TVIS_CUT);
1002 m_currentDragObject = NULL;
1003 return FALSE;
1004 }
1005
1006 }
1007
1008 if (bIsMove)
1009 ret = Move(item, parent);
1010 else
1011 ret = Copy(item, parent);
1012
1013 if(ret) m_currentDragObject = NULL;
1014 return ret;
1015
1016}
1017
1018bool FTPWindow::AcceptType(LPDATAOBJECT pDataObj) {
1019 FORMATETC fmtetc{};

Callers

nothing calls this directly

Calls 5

GetHWNDMethod · 0.80
GetChildByNameMethod · 0.45
GetNameMethod · 0.45
CreateMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected