Improve luks::supportCopy and luks::supportSetLabel.

This commit is contained in:
Andrius Štikonas 2016-05-18 02:04:33 +01:00
parent ecbbdb3b1d
commit 7914e0aa98
2 changed files with 7 additions and 5 deletions

View File

@ -282,8 +282,6 @@ bool luks::cryptClose(const QString& deviceNode)
m_passphrase.clear(); m_passphrase.clear();
setLabel({}); setLabel({});
m_SetLabel = cmdSupportNone;
m_Copy = cmdSupportCore;
setUUID(readUUID(deviceNode)); setUUID(readUUID(deviceNode));
setSectorsUsed(-1); setSectorsUsed(-1);
@ -300,8 +298,6 @@ void luks::loadInnerFileSystem(const QString& mapperNode)
FileSystem::Type innerFsType = detectFileSystem(mapperNode); FileSystem::Type innerFsType = detectFileSystem(mapperNode);
m_innerFs = FileSystemFactory::cloneWithNewType(innerFsType, m_innerFs = FileSystemFactory::cloneWithNewType(innerFsType,
*this); *this);
m_SetLabel = cmdSupportFileSystem;
m_Copy = cmdSupportNone;
setLabel(m_innerFs->readLabel(mapperNode)); setLabel(m_innerFs->readLabel(mapperNode));
setUUID(m_innerFs->readUUID(mapperNode)); setUUID(m_innerFs->readUUID(mapperNode));
if (m_innerFs->supportGetUsed() == FileSystem::cmdSupportFileSystem) // FIXME:also implement checking space if partition is mounted if (m_innerFs->supportGetUsed() == FileSystem::cmdSupportFileSystem) // FIXME:also implement checking space if partition is mounted

View File

@ -82,13 +82,19 @@ public:
return cmdSupportNone; return cmdSupportNone;
} }
CommandSupportType supportCopy() const override { CommandSupportType supportCopy() const override {
if (m_isCryptOpen)
return cmdSupportNone;
return m_Copy; return m_Copy;
} }
CommandSupportType supportBackup() const override { CommandSupportType supportBackup() const override {
return m_Backup; return m_Backup;
} }
CommandSupportType supportSetLabel() const override { CommandSupportType supportSetLabel() const override {
return m_SetLabel; if (!m_isCryptOpen)
return cmdSupportNone;
if (m_Check && m_innerFs)
return m_innerFs->supportSetLabel();
return cmdSupportNone;
} }
CommandSupportType supportUpdateUUID() const override { CommandSupportType supportUpdateUUID() const override {
return m_UpdateUUID; return m_UpdateUUID;