LVM support #6

Closed
andrius wants to merge 109 commits from (deleted):lvm-support-rebase into master
2 changed files with 9 additions and 6 deletions
Showing only changes of commit 2b9c63ffe0 - Show all commits

View File

@ -28,9 +28,10 @@
#include <QRegularExpression>
#include <QStringList>
#include <KMountPoint>
#include <KDiskFreeSpaceInfo>
#include <KLocalizedString>
#include <KMountPoint>
/** Constructs a representation of LVM device with functionning LV as Partition
*
@ -139,10 +140,12 @@ Partition* LvmDevice::scanPartition(const QString& lvpath, const LvmDevice& dev,
const KDiskFreeSpaceInfo freeSpaceInfo = KDiskFreeSpaceInfo::freeSpaceInfo(mountPoint);
//TODO: test used space report. probably incorrect
if (mounted && freeSpaceInfo.isValid() && mountPoint != QString()) {
fs->setSectorsUsed(freeSpaceInfo.used() / logicalSize());
} else if (fs->supportGetUsed() == FileSystem::cmdSupportFileSystem) {
fs->setSectorsUsed(fs->readUsedCapacity(lvpath) / logicalSize());
if (logicalSize() > 0) {
if (mounted && freeSpaceInfo.isValid() && mountPoint != QString()) {
fs->setSectorsUsed(freeSpaceInfo.used() / logicalSize());
} else if (fs->supportGetUsed() == FileSystem::cmdSupportFileSystem) {
fs->setSectorsUsed(fs->readUsedCapacity(lvpath) / logicalSize());
}
}
}

View File

@ -61,7 +61,7 @@ ExternalCommand::ExternalCommand(Report& report, const QString& cmd, const QStri
void ExternalCommand::setup()
{
setEnvironment(QStringList() << QStringLiteral("LC_ALL=C") << QStringLiteral("PATH=") + QString::fromUtf8(getenv("PATH")) << QStringLiteral("LVM_SUPPRESS_FD_WARNINGS=1"));
setProcessChannelMode(MergedChannels);
setProcessChannelMode(SeparateChannels);
connect(this, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, &ExternalCommand::onFinished);
connect(this, &ExternalCommand::readyReadStandardOutput, this, &ExternalCommand::onReadOutput);