Move to using static lvm2_pv methods.

This commit is contained in:
Chantara Tith 2016-07-08 03:24:30 +07:00 committed by Andrius Štikonas
parent a89dbbdd7d
commit 951cb925ea
1 changed files with 5 additions and 6 deletions

View File

@ -128,17 +128,16 @@ void InfoPane::showPartition(Qt::DockWidgetArea area, const Partition& p)
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", "PV Size:"), Capacity::formatByteSize(FS::lvm2_pv::getPVSize(deviceNode)), cols(area), x, y);
createLabels(i18nc("@label partition", "PE Size:"), Capacity::formatByteSize(FS::lvm2_pv::getPESize(deviceNode)), cols(area), x, y);
createLabels(i18nc("@label partition", "Total PE :"), QString::number(FS::lvm2_pv::getTotalPE(deviceNode)), cols(area), x, y);
createLabels(i18nc("@label partition", "Free PE:"), QString::number(FS::lvm2_pv::getFreePE(deviceNode)), cols(area), x, y);
createLabels(i18nc("@label partition", "Allocated PE:"), QString::number(FS::lvm2_pv::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);