MCPcopy Create free account
hub / github.com/bumptop/BumpTop / copyFileByName

Method copyFileByName

trunk/win/Source/BT_FileSystemManager.cpp:620–639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618}
619
620bool FileSystemManager::copyFileByName(QString oldPath, QString destDir, QString newFileName, bool confirm, bool silent, bool allowUndo)
621{
622 SHFILEOPSTRUCT fileOperation = { 0 };
623 QString fromPath(oldPath), toPath(destDir);
624 toPath = native(destDir / newFileName);
625
626 TCHAR oldp[MAX_PATH] = {0};
627 TCHAR newp[MAX_PATH] = {0};
628 lstrcpy(oldp, (LPCTSTR) fromPath.utf16());
629 lstrcpy(newp, (LPCTSTR) toPath.utf16());
630
631 fileOperation.hwnd = winOS->GetWindowsHandle();
632 fileOperation.wFunc = FO_COPY;
633 fileOperation.pFrom = (LPCTSTR) oldp;
634 fileOperation.pTo = (LPCTSTR) newp;
635 fileOperation.fFlags = FOF_RENAMEONCOLLISION | (allowUndo ? FOF_ALLOWUNDO : NULL) | (confirm ? NULL : FOF_NOCONFIRMATION) | (silent ? FOF_SILENT : NULL);
636
637 // do the windows file operations for copy
638 return (SHFileOperation(&fileOperation) == 0) && !fileOperation.fAnyOperationsAborted;
639}
640
641bool FileSystemManager::createFile(QString filePath)
642{

Callers 8

onStateChangedMethod · 0.80
onStateChangedMethod · 0.80
reloadDefaultThemeMethod · 0.80
onStateChangedMethod · 0.80
onStateChangedMethod · 0.80
Key_PasteSelectionFunction · 0.80
handleMessageMethod · 0.80

Calls 2

GetWindowsHandleMethod · 0.80
nativeFunction · 0.70

Tested by 3

onStateChangedMethod · 0.64
onStateChangedMethod · 0.64
onStateChangedMethod · 0.64