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:
parent
15a249eb54
commit
1479b61214
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user