1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

Simplify code for checking free disk space

`QStorageInfo::bytesAvailable()` is guaranteed to return `-1` for an
invalid path.
https://doc.qt.io/qt-5/qstorageinfo.html#bytesAvailable
This commit is contained in:
Chocobo1 2021-01-16 23:24:32 +08:00
parent 15a249eb54
commit 1479b61214
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -273,8 +273,6 @@ bool Utils::Fs::isValidFileSystemName(const QString &name, const bool allowSepar
qint64 Utils::Fs::freeDiskSpaceOnPath(const QString &path) qint64 Utils::Fs::freeDiskSpaceOnPath(const QString &path)
{ {
if (path.isEmpty()) return -1;
return QStorageInfo(path).bytesAvailable(); return QStorageInfo(path).bytesAvailable();
} }