forked from qt-creator/qt-creator
Introduce IDevice::bytesAvailable()
It's going to replace RemoteLinuxCheckForFreeDiskSpaceService. Change-Id: If8c30a57b9013387c69412f12102bcd4d41a88b5 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include <QFileInfo>
|
||||
#include <QOperatingSystemVersion>
|
||||
#include <QRegularExpression>
|
||||
#include <QStorageInfo>
|
||||
#include <QUrl>
|
||||
#include <qplatformdefs.h>
|
||||
|
||||
@@ -1421,6 +1422,16 @@ qint64 FilePath::fileSize() const
|
||||
return QFileInfo(m_data).size();
|
||||
}
|
||||
|
||||
qint64 FilePath::bytesAvailable() const
|
||||
{
|
||||
if (needsDevice()) {
|
||||
QTC_ASSERT(s_deviceHooks.bytesAvailable, return false);
|
||||
return s_deviceHooks.bytesAvailable(*this);
|
||||
}
|
||||
return QStorageInfo(m_data).bytesAvailable();
|
||||
}
|
||||
|
||||
|
||||
QTextStream &operator<<(QTextStream &s, const FilePath &fn)
|
||||
{
|
||||
return s << fn.toString();
|
||||
|
||||
Reference in New Issue
Block a user