示例#1
0
qlonglong DeviceInfo::availableDiskSpace() const
{
    QStorageInfo info;
    qlonglong diskSpace = 0;
    QStringList drives = info.allLogicalDrives();

    drives.removeDuplicates();

    foreach (const QString &drive, drives)
    {
        if (info.driveType(drive) == QStorageInfo::InternalDrive)
        {
            diskSpace += info.availableDiskSpace(drive);
        }
    }

    return diskSpace;
}
示例#2
0
/* Total size is in M */
inline s64 HddDevice::GetavailableDiskSpace(astring &strDevice)
{
	return m_Info.availableDiskSpace(strDevice.c_str()) / (1024 * 1024);
}