Rely on the partition role instead of the filesystem type.
This commit is contained in:
parent
29d3a92805
commit
cf4d687d54
|
@ -65,6 +65,8 @@
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <typeinfo>
|
||||||
|
|
||||||
class PartitionTreeWidgetItem : public QTreeWidgetItem
|
class PartitionTreeWidgetItem : public QTreeWidgetItem
|
||||||
{
|
{
|
||||||
Q_DISABLE_COPY(PartitionTreeWidgetItem)
|
Q_DISABLE_COPY(PartitionTreeWidgetItem)
|
||||||
|
@ -420,9 +422,10 @@ void PartitionManagerWidget::onDecryptPartition()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p->fileSystem().type() != FileSystem::Luks)
|
if (!p->roles().has(PartitionRole::Luks))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
FS::luks& luksFs = dynamic_cast<FS::luks&>(p->fileSystem());
|
FS::luks& luksFs = dynamic_cast<FS::luks&>(p->fileSystem());
|
||||||
|
|
||||||
if (luksFs.canCryptOpen(p->partitionPath())) {
|
if (luksFs.canCryptOpen(p->partitionPath())) {
|
||||||
|
@ -432,7 +435,10 @@ void PartitionManagerWidget::onDecryptPartition()
|
||||||
if (!luksFs.cryptClose(p->partitionPath()))
|
if (!luksFs.cryptClose(p->partitionPath()))
|
||||||
KMessageBox::detailedSorry(this, xi18nc("@info", "The encrypted file system on partition <filename>%1</filename> could not be locked.", p->deviceNode()), QString(), i18nc("@title:window", "Could Not Lock Encrypted File System."));
|
KMessageBox::detailedSorry(this, xi18nc("@info", "The encrypted file system on partition <filename>%1</filename> could not be locked.", p->deviceNode()), QString(), i18nc("@title:window", "Could Not Lock Encrypted File System."));
|
||||||
}
|
}
|
||||||
|
} catch (const std::bad_cast&)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
updatePartitions();
|
updatePartitions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue