[partition] [fsresizer] Fix KPMCore API versions

- tests need the defines as well
 - scandevices API changed with API 3.3.1
This commit is contained in:
Adriaan de Groot 2019-04-12 13:14:13 +02:00
parent c844188907
commit 198acadd23
4 changed files with 5 additions and 3 deletions

View File

@ -45,6 +45,7 @@ if ( KPMcore_FOUND )
) )
set_target_properties( fsresizertest PROPERTIES AUTOMOC TRUE ) set_target_properties( fsresizertest PROPERTIES AUTOMOC TRUE )
target_include_directories( fsresizertest PRIVATE /usr/local/include ) target_include_directories( fsresizertest PRIVATE /usr/local/include )
target_compile_definitions( fsresizertest PRIVATE ${_partition_defs} )
endif() endif()
else() else()
calamares_skip_module( "fsresizer (missing suitable KPMcore)" ) calamares_skip_module( "fsresizer (missing suitable KPMcore)" )

View File

@ -120,7 +120,7 @@ ResizeFSJob::PartitionMatch
ResizeFSJob::findPartition( CoreBackend* backend ) ResizeFSJob::findPartition( CoreBackend* backend )
{ {
using DeviceList = QList< Device* >; using DeviceList = QList< Device* >;
#ifdef WITH_KPMCORE4API #ifdef WITH_KPMCORE331API
DeviceList devices = backend->scanDevices( /* not includeReadOnly, not includeLoopback */ ScanFlag(0) ); DeviceList devices = backend->scanDevices( /* not includeReadOnly, not includeLoopback */ ScanFlag(0) );
#else #else
DeviceList devices = backend->scanDevices( /* excludeReadOnly */ true ); DeviceList devices = backend->scanDevices( /* excludeReadOnly */ true );

View File

@ -107,7 +107,7 @@ QList< Device* > getDevices( DeviceType which, qint64 minimumSize )
bool writableOnly = (which == DeviceType::WritableOnly); bool writableOnly = (which == DeviceType::WritableOnly);
CoreBackend* backend = CoreBackendManager::self()->backend(); CoreBackend* backend = CoreBackendManager::self()->backend();
#ifdef WITH_KPMCORE4API #ifdef WITH_KPMCORE331API
DeviceList devices = backend->scanDevices( /* not includeReadOnly, not includeLoopback */ ScanFlag(0) ); DeviceList devices = backend->scanDevices( /* not includeReadOnly, not includeLoopback */ ScanFlag(0) );
#else #else
DeviceList devices = backend->scanDevices( /* excludeReadOnly */ true ); DeviceList devices = backend->scanDevices( /* excludeReadOnly */ true );

View File

@ -32,4 +32,5 @@ if( ECM_FOUND AND BUILD_TESTING )
) )
set_target_properties( partitionjobtests PROPERTIES AUTOMOC TRUE ) set_target_properties( partitionjobtests PROPERTIES AUTOMOC TRUE )
target_compile_definitions( partitionjobtests PRIVATE ${_partition_defs} )
endif() endif()