Make sure to create the inner fs when detecting.

This commit is contained in:
Teo Mrnjavac 2016-04-13 18:32:21 +02:00
parent 7993257541
commit 9970fb7b1d
3 changed files with 12 additions and 4 deletions

View File

@ -286,10 +286,7 @@ bool luks::cryptOpen(const QString& deviceNode)
if (mapperNode.isEmpty())
return false;
FileSystem::Type innerFsType = detectFileSystem(mapperNode);
m_innerFs = FileSystemFactory::cloneWithNewType(innerFsType,
*this);
loadInnerFilesystem(mapperNode);
m_isCryptOpen = (m_innerFs != nullptr);
if (m_isCryptOpen)
@ -328,6 +325,13 @@ bool luks::cryptClose(const QString& deviceNode)
return false;
}
void luks::loadInnerFilesystem(const QString& mapperNode)
{
FileSystem::Type innerFsType = detectFileSystem(mapperNode);
m_innerFs = FileSystemFactory::cloneWithNewType(innerFsType,
*this);
}
bool luks::mount(const QString& deviceNode, const QString& mountPoint)
{
if (!m_isCryptOpen)

View File

@ -108,6 +108,8 @@ public:
bool cryptOpen(const QString& deviceNode);
bool cryptClose(const QString& deviceNode);
void loadInnerFilesystem(const QString& mapperNode);
virtual bool mount(const QString& deviceNode, const QString& mountPoint) override;
virtual bool unmount(const QString& deviceNode) override;

View File

@ -359,6 +359,8 @@ void LibPartedBackend::scanDevicePartitions(PedDevice*, Device& d, PedDisk* pedD
luksFs->setCryptOpen(isCryptOpen);
if (isCryptOpen) {
luksFs->loadInnerFilesystem(mapperNode);
mountPoint = mountPoints.findByDevice(mapperNode) ?
mountPoints.findByDevice(mapperNode)->mountPoint() :
QString();