Skip to content

Commit

Permalink
fix: enhance file copy logic for same device checks
Browse files Browse the repository at this point in the history
- Updated the check in checkAndCopyFile to ensure that big file copy logic only triggers if the source and target are on the same device.
- Added a condition to verify device equality using FileUtils::isSameDevice before initiating the big file copy process.

This change improves the file copy operation by preventing unnecessary delays and ensuring that
the big file copy logic is only applied when copying files across different devices, enhancing
overall performance and reliability.

Log: enhance file copy logic for same device checks
  • Loading branch information
liyigang1 authored and deepin-bot[bot] committed Jan 7, 2025
1 parent cc84bb6 commit a23af63
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ bool FileOperateBaseWorker::checkAndCopyFile(const DFileInfoPointer fromInfo, co
while (bigFileCopy && !isStopped()) {
QThread::msleep(10);
}
if (fromSize > bigFileSize) {
if (fromSize > bigFileSize && FileUtils::isSameDevice(fromInfo->uri(), targetUrl)) {
bigFileCopy = true;
auto result = doCopyLocalByRange(fromInfo, toInfo, skip);
bigFileCopy = false;
Expand Down

0 comments on commit a23af63

Please sign in to comment.