mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 00:33:09 -07:00
Improve error detection when saving files
This commit is contained in:
parent
6a6268c068
commit
81139c0098
5 changed files with 21 additions and 23 deletions
|
@ -47,9 +47,7 @@ namespace
|
|||
QFile file {filePath};
|
||||
if (!file.open(QIODevice::WriteOnly))
|
||||
return false;
|
||||
|
||||
file.write(replyData);
|
||||
return true;
|
||||
return (file.write(replyData) == replyData.length());
|
||||
}
|
||||
|
||||
QTemporaryFile tmpfile {Utils::Fs::tempPath() + "XXXXXX"};
|
||||
|
@ -59,9 +57,7 @@ namespace
|
|||
return false;
|
||||
|
||||
filePath = tmpfile.fileName();
|
||||
|
||||
tmpfile.write(replyData);
|
||||
return true;
|
||||
return (tmpfile.write(replyData) == replyData.length());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue