Make initLUKS function non-static.

This commit is contained in:
Andrius Štikonas 2016-11-30 17:18:51 +00:00
parent 52b356e45f
commit 2e960d5c00
4 changed files with 15 additions and 15 deletions

View File

@ -131,8 +131,10 @@ Partition* LvmDevice::scanPartition(const QString& lvPath, PartitionTable* pTabl
// Handle LUKS partition
if (fs->type() == FileSystem::Luks) {
r |= PartitionRole::Luks;
FS::luks::initLUKS(fs);
QString mapperNode = static_cast<FS::luks*>(fs)->mapperName();
FS::luks* luksFs = static_cast<FS::luks*>(fs);
luksFs->initLUKS();
QString mapperNode = luksFs->mapperName();
mountPoint = FileSystem::detectMountPoint(fs, mapperNode);
mounted = FileSystem::detectMountStatus(fs, mapperNode);
} else {

View File

@ -642,17 +642,14 @@ bool luks::canEncryptType(FileSystem::Type type)
}
}
void luks::initLUKS(FileSystem* fs)
void luks::initLUKS()
{
if (fs->type() == FileSystem::Luks) {
FS::luks* luksFS = static_cast<FS::luks*>(fs);
QString mapperNode = luksFS->mapperName();
bool isCryptOpen = !mapperNode.isEmpty();
luksFS->setCryptOpen(isCryptOpen);
if (isCryptOpen) {
luksFS->loadInnerFileSystem(mapperNode);
luksFS->setMounted(detectMountStatus(luksFS->innerFS(), mapperNode));
}
QString mapperNode = mapperName();
bool isCryptOpen = !mapperNode.isEmpty();
setCryptOpen(isCryptOpen);
if (isCryptOpen) {
loadInnerFileSystem(mapperNode);
setMounted(detectMountStatus(innerFS(), mapperNode));
}
}

View File

@ -181,7 +181,7 @@ public:
qint64 payloadOffset() const { return m_PayloadOffset; }
static bool canEncryptType(FileSystem::Type type);
static void initLUKS(FileSystem* fs);
void initLUKS();
protected:
virtual QString readOuterUUID(const QString& deviceNode) const;

View File

@ -340,8 +340,9 @@ void LibPartedBackend::scanDevicePartitions(Device& d, PedDisk* pedDisk)
// libparted does not handle LUKS partitions
if (fs->type() == FileSystem::Luks) {
r |= PartitionRole::Luks;
FS::luks::initLUKS(fs);
QString mapperNode = static_cast<FS::luks*>(fs)->mapperName();
FS::luks* luksFs = static_cast<FS::luks*>(fs);
luksFs->initLUKS();
QString mapperNode = luksFs->mapperName();
mountPoint = FileSystem::detectMountPoint(fs, mapperNode);
mounted = FileSystem::detectMountStatus(fs, mapperNode);
} else {