Port FileSystem::luks away from KDiskFreeSpaceInfo.
This commit is contained in:
parent
a041090168
commit
6c433c264c
|
@ -36,10 +36,10 @@
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
#include <QStorageInfo>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
|
|
||||||
#include <KDiskFreeSpaceInfo>
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KPasswordDialog>
|
#include <KPasswordDialog>
|
||||||
|
|
||||||
|
@ -337,7 +337,7 @@ void luks::loadInnerFileSystem(const QString& mapperNode)
|
||||||
setLabel(m_innerFs->readLabel(mapperNode));
|
setLabel(m_innerFs->readLabel(mapperNode));
|
||||||
setUUID(m_innerFs->readUUID(mapperNode));
|
setUUID(m_innerFs->readUUID(mapperNode));
|
||||||
if (m_innerFs->supportGetUsed() == FileSystem::cmdSupportFileSystem)
|
if (m_innerFs->supportGetUsed() == FileSystem::cmdSupportFileSystem)
|
||||||
setSectorsUsed(std::ceil((m_innerFs->readUsedCapacity(mapperNode) + payloadOffset()) / static_cast<float>(sectorSize()) ));
|
setSectorsUsed(std::ceil((m_innerFs->readUsedCapacity(mapperNode) + payloadOffset()) / static_cast<double>(sectorSize()) ));
|
||||||
m_innerFs->scan(mapperNode);
|
m_innerFs->scan(mapperNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,9 +393,9 @@ bool luks::mount(Report& report, const QString& deviceNode, const QString& mount
|
||||||
{
|
{
|
||||||
m_isMounted = true;
|
m_isMounted = true;
|
||||||
|
|
||||||
const KDiskFreeSpaceInfo freeSpaceInfo = KDiskFreeSpaceInfo::freeSpaceInfo(mountPoint);
|
const QStorageInfo storageInfo = QStorageInfo(mountPoint);
|
||||||
if (freeSpaceInfo.isValid() && !mountPoint.isEmpty())
|
if (storageInfo.isValid() && !mountPoint.isEmpty())
|
||||||
setSectorsUsed((freeSpaceInfo.used() + payloadOffset()) / sectorSize());
|
setSectorsUsed( (storageInfo.bytesTotal() - storageInfo.bytesFree() + payloadOffset()) / sectorSize());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue