Leave LUKS cmdSupport variables static for now.

This commit is contained in:
Andrius Štikonas 2016-05-18 17:39:28 +01:00
parent 6f8a2c7016
commit fdfc47cf8f
2 changed files with 35 additions and 17 deletions

View File

@ -37,6 +37,19 @@
namespace FS
{
FileSystem::CommandSupportType luks::m_GetUsed = FileSystem::cmdSupportNone;
FileSystem::CommandSupportType luks::m_GetLabel = FileSystem::cmdSupportNone;
FileSystem::CommandSupportType luks::m_Create = FileSystem::cmdSupportNone;
FileSystem::CommandSupportType luks::m_Grow = FileSystem::cmdSupportNone;
FileSystem::CommandSupportType luks::m_Shrink = FileSystem::cmdSupportNone;
FileSystem::CommandSupportType luks::m_Move = FileSystem::cmdSupportNone;
FileSystem::CommandSupportType luks::m_Check = FileSystem::cmdSupportNone;
FileSystem::CommandSupportType luks::m_Copy = FileSystem::cmdSupportNone;
FileSystem::CommandSupportType luks::m_Backup = FileSystem::cmdSupportNone;
FileSystem::CommandSupportType luks::m_SetLabel = FileSystem::cmdSupportNone;
FileSystem::CommandSupportType luks::m_UpdateUUID = FileSystem::cmdSupportNone;
FileSystem::CommandSupportType luks::m_GetUUID = FileSystem::cmdSupportNone;
luks::luks(qint64 firstsector,
qint64 lastsector,
qint64 sectorsused,
@ -45,6 +58,15 @@ luks::luks(qint64 firstsector,
, m_innerFs(nullptr)
, m_isCryptOpen(false)
, m_isMounted(false)
{
}
luks::~luks()
{
delete m_innerFs;
}
void luks::init()
{
m_Create = findExternal(QStringLiteral("cryptsetup")) ? cmdSupportFileSystem : cmdSupportNone;
m_SetLabel = cmdSupportNone;
@ -60,11 +82,6 @@ luks::luks(qint64 firstsector,
m_GetUUID = findExternal(QStringLiteral("cryptsetup")) ? cmdSupportFileSystem : cmdSupportNone;
}
luks::~luks()
{
delete m_innerFs;
}
bool luks::supportToolFound() const
{
m_cryptsetupFound = findExternal(QStringLiteral("cryptsetup")) ? cmdSupportFileSystem : cmdSupportNone;

View File

@ -44,6 +44,7 @@ public:
virtual ~luks();
public:
void init() override;
qint64 readUsedCapacity(const QString& deviceNode) const override;
CommandSupportType supportGetUsed() const override {
@ -161,18 +162,18 @@ protected:
virtual QString readOuterUUID(const QString& deviceNode) const;
public:
CommandSupportType m_GetUsed;
CommandSupportType m_GetLabel;
CommandSupportType m_Create;
CommandSupportType m_Grow;
CommandSupportType m_Shrink;
CommandSupportType m_Move;
CommandSupportType m_Check;
CommandSupportType m_Copy;
CommandSupportType m_Backup;
CommandSupportType m_SetLabel;
CommandSupportType m_UpdateUUID;
CommandSupportType m_GetUUID;
static CommandSupportType m_GetUsed;
static CommandSupportType m_GetLabel;
static CommandSupportType m_Create;
static CommandSupportType m_Grow;
static CommandSupportType m_Shrink;
static CommandSupportType m_Move;
static CommandSupportType m_Check;
static CommandSupportType m_Copy;
static CommandSupportType m_Backup;
static CommandSupportType m_SetLabel;
static CommandSupportType m_UpdateUUID;
static CommandSupportType m_GetUUID;
private:
mutable FileSystem* m_innerFs;