Fix mountpointdialog for encrypted filesystems.

This commit is contained in:
Andrius Štikonas 2016-05-24 16:35:39 +01:00
parent a7c4358621
commit 88fa3c3697
3 changed files with 12 additions and 6 deletions

View File

@ -31,7 +31,6 @@ class EditMountOptionsDialogWidget : public QWidget, public Ui::EditMountOptions
public:
EditMountOptionsDialogWidget(QWidget* parent, const QStringList& options);
public:
QPlainTextEdit& editOptions() {
return *m_EditOptions;
}

View File

@ -23,6 +23,7 @@
#include <core/mountentry.h>
#include <fs/filesystem.h>
#include <fs/luks.h>
#include <KLocalizedString>
#include <KIOCore/KMountPoint>
@ -63,13 +64,18 @@ EditMountPointDialogWidget::EditMountPointDialogWidget(QWidget* parent, const Pa
setupUi(this);
labelName().setText(partition().deviceNode());
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);
}
labelName().setText(m_deviceNode);
labelType().setText(partition().fileSystem().name());
if (mountPoints().find(partition().deviceNode()) == mountPoints().end())
mountPoints()[partition().deviceNode()] = new MountEntry(partition().deviceNode(), QString(), partition().fileSystem().name(), QStringList(), 0, 0, MountEntry::deviceNode);
if (mountPoints().find(m_deviceNode) == mountPoints().end())
mountPoints()[m_deviceNode] = new MountEntry(m_deviceNode, QString(), partition().fileSystem().name(), QStringList(), 0, 0, MountEntry::deviceNode);
MountEntry* entry = mountPoints()[partition().deviceNode()];
MountEntry* entry = mountPoints()[m_deviceNode];
Q_ASSERT(entry);
@ -241,7 +247,7 @@ bool EditMountPointDialogWidget::acceptChanges()
else if (radioLabel().isChecked() && !partition().fileSystem().label().isEmpty())
entry->name = QStringLiteral("LABEL=") + partition().fileSystem().label();
else
entry->name = partition().deviceNode();
entry->name = m_deviceNode;
return true;
}

View File

@ -101,6 +101,7 @@ private:
const Partition& m_Partition;
QMap<QString, MountEntry*> m_MountPoints;
QString m_Options;
QString m_deviceNode;
QMap<QString, QCheckBox*> m_BoxOptions;
};