Convert FS::luks static cmdSupport members to non-static.

This commit is contained in:
Andrius Štikonas 2016-05-11 18:01:21 +01:00
parent 7c137c36c6
commit 513bbdac4c
4 changed files with 27 additions and 27 deletions

View File

@ -98,7 +98,7 @@ void FileSystemFactory::init()
FS::hpfs::init();
FS::jfs::init();
FS::linuxswap::init();
FS::luks::init();
// FS::luks::init();
FS::lvm2_pv::init();
FS::nilfs2::init();
FS::ntfs::init();

View File

@ -37,19 +37,6 @@
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,
@ -59,6 +46,18 @@ luks::luks(qint64 firstsector,
, 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()

View File

@ -44,7 +44,7 @@ public:
virtual ~luks();
public:
static void init();
void init();
virtual qint64 readUsedCapacity(const QString& deviceNode) const override;
virtual CommandSupportType supportGetUsed() const override {
@ -154,18 +154,18 @@ protected:
virtual QString readOuterUUID(const QString& deviceNode) const;
public:
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;
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;
private:
mutable FileSystem* m_innerFs;

View File

@ -361,6 +361,7 @@ 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);