Update to latest KPMcore API (cache luks specific values during the scan).

This commit is contained in:
Andrius Štikonas 2016-09-04 23:34:16 +01:00
parent 98150d48bb
commit 19cd61dad0
3 changed files with 9 additions and 8 deletions

View File

@ -66,7 +66,7 @@ EditMountPointDialogWidget::EditMountPointDialogWidget(QWidget* parent, const Pa
m_deviceNode = partition().deviceNode();
if (partition().roles().has(PartitionRole::Luks) && partition().fileSystem().type() != FileSystem::Luks) {
const FS::luks* luksFs = dynamic_cast<const FS::luks*>(&partition().fileSystem());
m_deviceNode = luksFs->mapperName(m_deviceNode);
m_deviceNode = luksFs->mapperName();
}
labelName().setText(m_deviceNode);
labelType().setText(partition().fileSystem().name());

View File

@ -118,11 +118,11 @@ void InfoPane::showPartition(Qt::DockWidgetArea area, const Partition& p)
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", "Cipher name:"), luksFs->getCipherName(deviceNode), cols(area), x, y);
createLabels(i18nc("@label partition", "Cipher mode:"), luksFs->getCipherMode(deviceNode), cols(area), x, y);
createLabels(i18nc("@label partition", "Hash:"), luksFs->getHashName(deviceNode), cols(area), x, y);
createLabels(i18nc("@label partition", "Key size:"), QString::number(luksFs->getKeySize(deviceNode)), cols(area), x, y);
createLabels(i18nc("@label partition", "Payload offset:"), Capacity::formatByteSize(luksFs->getPayloadOffset(deviceNode)), cols(area), x, y);
createLabels(i18nc("@label partition", "Cipher name:"), luksFs->cipherName(), cols(area), x, y);
createLabels(i18nc("@label partition", "Cipher mode:"), luksFs->cipherMode(), cols(area), x, y);
createLabels(i18nc("@label partition", "Hash:"), luksFs->hashName(), cols(area), x, y);
createLabels(i18nc("@label partition", "Key size:"), QString::number(luksFs->keySize()), cols(area), x, y);
createLabels(i18nc("@label partition", "Payload offset:"), Capacity::formatByteSize(luksFs->payloadOffset()), 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);

View File

@ -513,7 +513,9 @@ void MainWindow::enableActions()
->setEnabled(CreateVolumeGroupOperation::canCreate());
bool lvmDevice = pmWidget().selectedDevice() && pmWidget().selectedDevice()->type() == Device::LVM_Device;
bool removable = pmWidget().selectedDevice() && !LvmDevice::getLVs(pmWidget().selectedDevice()->name()).count();
bool removable = false;
if (lvmDevice && !LvmDevice::getLVs(pmWidget().selectedDevice()->name()).count())
removable = true;
actionCollection()->action(QStringLiteral("removeVolumeGroup"))->setEnabled(removable);
actionCollection()->action(QStringLiteral("removeVolumeGroup"))->setVisible(lvmDevice);
@ -525,7 +527,6 @@ void MainWindow::enableActions()
actionCollection()->action(QStringLiteral("resizeVolumeGroup"))->setEnabled(lvmDevice);
actionCollection()->action(QStringLiteral("resizeVolumeGroup"))->setVisible(lvmDevice);
const Partition* part = pmWidget().selectedPartition();
actionCollection()->action(QStringLiteral("newPartition"))