Add PV's info to the infopane #1

Closed
Ghost wants to merge 1 commits from (deleted):lvm-support into master
1 changed files with 16 additions and 0 deletions

View File

@ -23,6 +23,7 @@
#include <fs/filesystem.h>
#include <fs/luks.h>
#include <fs/lvm2_pv.h>
#include <util/capacity.h>
@ -124,6 +125,21 @@ void InfoPane::showPartition(Qt::DockWidgetArea area, const Partition& p)
createLabels(i18nc("@label partition", "First sector:"), QLocale().toString(p.firstSector()), cols(area), x, y);
createLabels(i18nc("@label partition", "Last sector:"), QLocale().toString(p.lastSector()), cols(area), x, y);
createLabels(i18nc("@label partition", "Number of sectors:"), QLocale().toString(p.length()), cols(area), x, y);
} else if (p.fileSystem().type() == FileSystem::Lvm2_PV) {
const FS::lvm2_pv* lvm = dynamic_cast<const FS::lvm2_pv*>(&p.fileSystem());
QString deviceNode = p.partitionPath();
createLabels(i18nc("@label partition", "File system:"), p.fileSystem().name(), cols(area), x, y);
createLabels(i18nc("@label partition", "Capacity:"), Capacity::formatByteSize(p.capacity()), cols(area), x, y);
createLabels(i18nc("@label partition", "Available:"), Capacity::formatByteSize(p.available()), cols(area), x, y);
createLabels(i18nc("@label partition", "Used:"), Capacity::formatByteSize(p.used()), cols(area), x, y);
createLabels(i18nc("@label partition", "PV Size:"), Capacity::formatByteSize(lvm->getPVSize(deviceNode)), cols(area), x, y);
createLabels(i18nc("@label partition", "PE Size:"), Capacity::formatByteSize(lvm->getPESize(deviceNode)), cols(area), x, y);
createLabels(i18nc("@label partition", "Total PE :"), QString::number(lvm->getTotalPE(deviceNode)), cols(area), x, y);
createLabels(i18nc("@label partition", "Free PE:"), QString::number(lvm->getFreePE(deviceNode)), cols(area), x, y);
createLabels(i18nc("@label partition", "Allocated PE:"), QString::number(lvm->getAllocatedPE(deviceNode)), cols(area), x, y);
createLabels(i18nc("@label partition", "First sector:"), QLocale().toString(p.firstSector()), cols(area), x, y);
createLabels(i18nc("@label partition", "Last sector:"), QLocale().toString(p.lastSector()), cols(area), x, y);
createLabels(i18nc("@label partition", "Number of sectors:"), QLocale().toString(p.length()), cols(area), x, y);
} else {
createLabels(i18nc("@label partition", "File system:"), p.fileSystem().name(), cols(area), x, y);
createLabels(i18nc("@label partition", "Capacity:"), Capacity::formatByteSize(p.capacity()), cols(area), x, y);