Move luks init code to constructor.
This commit is contained in:
parent
142ff07938
commit
a610e24686
|
@ -45,27 +45,6 @@ luks::luks(qint64 firstsector,
|
|||
, m_innerFs(nullptr)
|
||||
, m_isCryptOpen(false)
|
||||
, m_isMounted(false)
|
||||
{
|
||||
m_GetUsed = FileSystem::cmdSupportNone;
|
||||
m_GetLabel = FileSystem::cmdSupportNone;
|
||||
m_Create = FileSystem::cmdSupportNone;
|
||||
m_Grow = FileSystem::cmdSupportNone;
|
||||
m_Shrink = FileSystem::cmdSupportNone;
|
||||
m_Move = FileSystem::cmdSupportNone;
|
||||
m_Check = FileSystem::cmdSupportNone;
|
||||
m_Copy = FileSystem::cmdSupportNone;
|
||||
m_Backup = FileSystem::cmdSupportNone;
|
||||
m_SetLabel = FileSystem::cmdSupportNone;
|
||||
m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||
m_GetUUID = FileSystem::cmdSupportNone;
|
||||
}
|
||||
|
||||
luks::~luks()
|
||||
{
|
||||
delete m_innerFs;
|
||||
}
|
||||
|
||||
void luks::init()
|
||||
{
|
||||
// m_Create = findExternal(QStringLiteral("cryptsetup")) ? cmdSupportFileSystem : cmdSupportNone;
|
||||
m_SetLabel = cmdSupportNone;
|
||||
|
@ -81,6 +60,11 @@ void luks::init()
|
|||
m_GetUUID = findExternal(QStringLiteral("cryptsetup")) ? cmdSupportFileSystem : cmdSupportNone;
|
||||
}
|
||||
|
||||
luks::~luks()
|
||||
{
|
||||
delete m_innerFs;
|
||||
}
|
||||
|
||||
bool luks::supportToolFound() const
|
||||
{
|
||||
m_cryptsetupFound = findExternal(QStringLiteral("cryptsetup")) ? cmdSupportFileSystem : cmdSupportNone;
|
||||
|
|
|
@ -44,7 +44,6 @@ public:
|
|||
virtual ~luks();
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
qint64 readUsedCapacity(const QString& deviceNode) const override;
|
||||
|
||||
CommandSupportType supportGetUsed() const override {
|
||||
|
|
|
@ -361,7 +361,6 @@ void LibPartedBackend::scanDevicePartitions(Device& d, PedDisk* pedDisk)
|
|||
if (type == FileSystem::Luks) {
|
||||
r |= PartitionRole::Luks;
|
||||
FS::luks* luksFs = dynamic_cast<FS::luks*>(fs);
|
||||
luksFs->init();
|
||||
QString mapperNode = FS::luks::mapperName(node);
|
||||
bool isCryptOpen = !mapperNode.isEmpty();
|
||||
luksFs->setCryptOpen(isCryptOpen);
|
||||
|
|
Loading…
Reference in New Issue