Browse Source

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
adaptive-webui-19844
Chocobo1 4 years ago
parent
commit
1479b61214
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 2
      src/base/utils/fs.cpp

2
src/base/utils/fs.cpp

@ -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…
Cancel
Save