mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07: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
1 changed files with 0 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue