kpmcore now requires passing sector size to FileSystem.

main
Andrius Štikonas 7 years ago
parent 73a75e837b
commit 252006ea25

@ -8,6 +8,10 @@ find_package( KF5 REQUIRED CoreAddons )
# These are needed because KPMcore links publicly against ConfigCore, I18n, IconThemes, KIOCore and Service
find_package( KF5 REQUIRED Config I18n IconThemes KIO Service )
find_package( KPMcore 3.1.50 )
if ( ${KPMcore_FOUND} )
add_definitions(-DWITH_KPMCORE22)
endif()
find_package( KPMcore 3.0.3 REQUIRED )
find_library( atasmart_LIB atasmart )
find_library( blkid_LIB blkid )

@ -23,6 +23,7 @@
#include "core/PartitionIterator.h"
// KPMcore
#include <kpmcore/core/device.h>
#include <kpmcore/core/partition.h>
#include <kpmcore/fs/filesystemfactory.h>
#include <kpmcore/backend/corebackendmanager.h>
@ -114,7 +115,11 @@ createNewPartition( PartitionNode* parent,
qint64 lastSector,
PartitionTable::Flags flags )
{
FileSystem* fs = FileSystemFactory::create( fsType, firstSector, lastSector );
FileSystem* fs = FileSystemFactory::create( fsType, firstSector, lastSector
#ifdef WITH_KPMCORE22
,device.logicalSize()
#endif
);
return new Partition(
parent,
device,
@ -147,7 +152,11 @@ createNewEncryptedPartition( PartitionNode* parent,
FS::luks* fs = dynamic_cast< FS::luks* >(
FileSystemFactory::create( FileSystem::Luks,
firstSector,
lastSector ) );
lastSector
#ifdef WITH_KPMCORE22
,device.logicalSize()
#endif
) );
if ( !fs )
{
qDebug() << "ERROR: cannot create LUKS filesystem. Giving up.";
@ -177,6 +186,9 @@ clonePartition( Device* device, Partition* partition )
partition->fileSystem().type(),
partition->firstSector(),
partition->lastSector()
#ifdef WITH_KPMCORE22
,device->logicalSize()
#endif
);
return new Partition( partition->parent(),
*device,

@ -217,7 +217,11 @@ PartitionJobTests::newCreatePartitionJob( Partition* freeSpacePartition, Partiti
lastSector = firstSector + size / m_device->logicalSize();
else
lastSector = freeSpacePartition->lastSector();
FileSystem* fs = FileSystemFactory::create( type, firstSector, lastSector );
FileSystem* fs = FileSystemFactory::create( type, firstSector, lastSector
#ifdef WITH_KPMCORE22
,m_device->logicalSize()
#endif
);
Partition* partition = new Partition(
freeSpacePartition->parent(),

Loading…
Cancel
Save