| 317 | } |
| 318 | |
| 319 | bool FileSystemManager::deleteFileByName(QString filePath, bool silent, bool skipRecycleBin, bool confirm) |
| 320 | { |
| 321 | TCHAR filep[MAX_PATH] = {0}; |
| 322 | lstrcpy(filep, (LPCTSTR) filePath.utf16()); |
| 323 | |
| 324 | SHFILEOPSTRUCT fileOp = { 0 }; |
| 325 | fileOp.hwnd = winOS->GetWindowsHandle(); |
| 326 | fileOp.wFunc = FO_DELETE; |
| 327 | fileOp.pFrom = filep; |
| 328 | fileOp.pTo = L"\0\0"; |
| 329 | fileOp.fFlags = (skipRecycleBin ? 0 : FOF_ALLOWUNDO) | (confirm ? NULL : FOF_NOCONFIRMATION) | (silent ? FOF_SILENT : 0); |
| 330 | bool result = (SHFileOperation(&fileOp) == 0) && !fileOp.fAnyOperationsAborted; |
| 331 | |
| 332 | return result; |
| 333 | } |
| 334 | |
| 335 | bool FileSystemManager::renameFile(FileSystemActor *obj, QString newName, bool confirm) |
| 336 | { |