mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 06:01:33 -06: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:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user