Do not report free space for swap partitions.

Swap partitions have no mount path so KDiskFreeSpaceInfo shows
total free disk space available.

BUG:357363
This commit is contained in:
Andrius Štikonas 2016-02-21 19:22:35 +00:00
parent 20bb8eba7e
commit 227c77e801
1 changed files with 1 additions and 1 deletions

View File

@ -206,7 +206,7 @@ static void readSectorsUsed(PedDisk* pedDisk, const Device& d, Partition& p, con
const KDiskFreeSpaceInfo freeSpaceInfo = KDiskFreeSpaceInfo::freeSpaceInfo(mountPoint);
if (p.isMounted() && freeSpaceInfo.isValid())
if (p.isMounted() && freeSpaceInfo.isValid() && mountPoint != QStringLiteral())
p.fileSystem().setSectorsUsed(freeSpaceInfo.used() / d.logicalSectorSize());
else if (p.fileSystem().supportGetUsed() == FileSystem::cmdSupportFileSystem)
p.fileSystem().setSectorsUsed(p.fileSystem().readUsedCapacity(p.deviceNode()) / d.logicalSectorSize());