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