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

View File

@ -82,13 +82,19 @@ public:
return cmdSupportNone;
}
CommandSupportType supportCopy() const override {
if (m_isCryptOpen)
return cmdSupportNone;
return m_Copy;
}
CommandSupportType supportBackup() const override {
return m_Backup;
}
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 {
return m_UpdateUUID;