[partition] Require modern KPMCore

This commit is contained in:
Adriaan de Groot 2022-03-21 23:44:20 +01:00
parent 49c56add7d
commit aedb55ea36
19 changed files with 7 additions and 152 deletions

View File

@ -10,7 +10,7 @@
if ( NOT KPMcore_searched_for ) if ( NOT KPMcore_searched_for )
set( KPMcore_searched_for TRUE ) set( KPMcore_searched_for TRUE )
find_package( KPMcore 3.3 ) find_package( KPMcore 21.12.0 )
set_package_properties( set_package_properties(
KPMcore PROPERTIES KPMcore PROPERTIES
URL "https://invent.kde.org/kde/kpmcore" URL "https://invent.kde.org/kde/kpmcore"
@ -21,18 +21,6 @@ if ( NOT KPMcore_searched_for )
if( KPMcore_FOUND ) if( KPMcore_FOUND )
set( KPMcore_API_DEFINITIONS "" ) set( KPMcore_API_DEFINITIONS "" )
if( KPMcore_VERSION VERSION_GREATER "3.3.70" AND KPMcore_VERSION VERSION_LESS "4.0" )
message( FATAL_ERROR "KPMCore beta versions ${KPMcore_VERSION} not supported" )
endif()
if ( KPMcore_VERSION VERSION_GREATER "3.3.0")
list( APPEND KPMcore_API_DEFINITIONS WITH_KPMCORE331API) # kpmcore > 3.3.0 with deprecations
endif()
if ( KPMcore_VERSION VERSION_GREATER_EQUAL "4.0")
list( APPEND KPMcore_API_DEFINITIONS WITH_KPMCORE4API) # kpmcore 4 with new API
endif()
if( KPMcore_VERSION VERSION_GREATER_EQUAL "4.2" )
list( APPEND KPMcore_API_DEFINITIONS WITH_KPMCORE42API) # kpmcore 4.2 with new API
endif()
else() else()
set( KPMcore_API_DEFINITIONS WITHOUT_KPMcore ) set( KPMcore_API_DEFINITIONS WITHOUT_KPMcore )
endif() endif()

View File

@ -17,13 +17,10 @@
#define PARTITION_GLOBAL_H #define PARTITION_GLOBAL_H
#include "DllMacro.h" #include "DllMacro.h"
#include "FileSystem.h"
#include "JobQueue.h" #include "JobQueue.h"
#ifdef WITH_KPMCORE4API
#include "FileSystem.h"
#include <kpmcore/fs/filesystem.h> #include <kpmcore/fs/filesystem.h>
#endif
namespace CalamaresUtils namespace CalamaresUtils
{ {
@ -78,7 +75,6 @@ isFilesystemUsedGS( const QString& filesystemType )
return isFilesystemUsedGS( Calamares::JobQueue::instanceGlobalStorage(), filesystemType ); return isFilesystemUsedGS( Calamares::JobQueue::instanceGlobalStorage(), filesystemType );
} }
#ifdef WITH_KPMCORE4API
/** @brief Mark a particular filesystem type as used (or not) /** @brief Mark a particular filesystem type as used (or not)
* *
* See useFilesystemGS(const QString&, bool); this method uses the filesystem type * See useFilesystemGS(const QString&, bool); this method uses the filesystem type
@ -100,7 +96,6 @@ isFilesystemUsedGS( FileSystem::Type filesystem )
return isFilesystemUsedGS( untranslatedFS( filesystem ) ); return isFilesystemUsedGS( untranslatedFS( filesystem ) );
} }
#endif
} // namespace Partition } // namespace Partition
} // namespace CalamaresUtils } // namespace CalamaresUtils

View File

@ -14,10 +14,7 @@
#include <kpmcore/backend/corebackend.h> #include <kpmcore/backend/corebackend.h>
#include <kpmcore/backend/corebackendmanager.h> #include <kpmcore/backend/corebackendmanager.h>
#if defined( WITH_KPMCORE4API )
#include <kpmcore/util/externalcommand.h> #include <kpmcore/util/externalcommand.h>
#endif
#include <QObject> #include <QObject>
@ -30,7 +27,6 @@ class InternalManager
{ {
public: public:
InternalManager(); InternalManager();
~InternalManager();
}; };
static bool s_kpm_loaded = false; static bool s_kpm_loaded = false;
@ -69,22 +65,6 @@ InternalManager::InternalManager()
} }
} }
InternalManager::~InternalManager()
{
#if defined( WITH_KPMCORE4API ) && !defined( WITH_KPMCORE42API )
cDebug() << "Cleaning up KPMCore backend ..";
// From KPMcore 4.0 until KPMcore 4.2 we needed to stop
// the helper by hand. KPMcore 4.2 ported to polkit directly,
// which doesn't need a helper.
auto backend_p = CoreBackendManager::self()->backend();
if ( backend_p )
{
ExternalCommand::stopHelper();
}
#endif
}
std::shared_ptr< InternalManager > std::shared_ptr< InternalManager >
getInternal() getInternal()
{ {
@ -102,9 +82,7 @@ KPMManager::KPMManager()
{ {
} }
KPMManager::~KPMManager() KPMManager::~KPMManager() {}
{
}
KPMManager::operator bool() const KPMManager::operator bool() const
{ {

View File

@ -57,18 +57,10 @@ KPMTests::testFlagNames()
QCOMPARE( PartitionTable::flagName( static_cast< PartitionTable::Flag >( 1 ) ), QStringLiteral( "boot" ) ); QCOMPARE( PartitionTable::flagName( static_cast< PartitionTable::Flag >( 1 ) ), QStringLiteral( "boot" ) );
#ifdef WITH_KPMCORE4API
// KPMCore 4 unifies the flags and handles them internally // KPMCore 4 unifies the flags and handles them internally
QCOMPARE( PartitionTable::flagName( PartitionTable::Flag::Boot ), QStringLiteral( "boot" ) ); QCOMPARE( PartitionTable::flagName( PartitionTable::Flag::Boot ), QStringLiteral( "boot" ) );
QVERIFY( names.contains( QStringLiteral( "boot" ) ) ); QVERIFY( names.contains( QStringLiteral( "boot" ) ) );
QVERIFY( !names.contains( QStringLiteral( "esp" ) ) ); QVERIFY( !names.contains( QStringLiteral( "esp" ) ) );
#else
// KPMCore 3 has separate flags
QCOMPARE( PartitionTable::flagName( PartitionTable::FlagBoot ), QStringLiteral( "boot" ) );
QCOMPARE( PartitionTable::flagName( PartitionTable::FlagEsp ), QStringLiteral( "esp" ) );
QVERIFY( names.contains( QStringLiteral( "boot" ) ) );
QVERIFY( names.contains( QStringLiteral( "esp" ) ) );
#endif
} }
void void

View File

@ -50,12 +50,7 @@ isPartitionFreeSpace( const Partition* partition )
bool bool
isPartitionNew( const Partition* partition ) isPartitionNew( const Partition* partition )
{ {
#if defined( WITH_KPMCORE4API ) return partition->state() == Partition::State::New;
constexpr auto NewState = Partition::State::New;
#else
constexpr auto NewState = Partition::StateNew;
#endif
return partition->state() == NewState;
} }

View File

@ -49,12 +49,8 @@ ResizeFSJob::PartitionMatch
ResizeFSJob::findPartition() ResizeFSJob::findPartition()
{ {
using DeviceList = QList< Device* >; using DeviceList = QList< Device* >;
#if defined( WITH_KPMCORE4API )
DeviceList devices DeviceList devices
= m_kpmcore.backend()->scanDevices( /* not includeReadOnly, not includeLoopback */ ScanFlag( 0 ) ); = m_kpmcore.backend()->scanDevices( /* not includeReadOnly, not includeLoopback */ ScanFlag( 0 ) );
#else
DeviceList devices = m_kpmcore.backend()->scanDevices( /* excludeReadOnly */ true );
#endif
cDebug() << "ResizeFSJob found" << devices.count() << "devices."; cDebug() << "ResizeFSJob found" << devices.count() << "devices.";
for ( DeviceList::iterator dev_it = devices.begin(); dev_it != devices.end(); ++dev_it ) for ( DeviceList::iterator dev_it = devices.begin(); dev_it != devices.end(); ++dev_it )

View File

@ -508,11 +508,6 @@ PartitionViewStep::onLeave()
{ {
const QString espMountPoint const QString espMountPoint
= Calamares::JobQueue::instance()->globalStorage()->value( "efiSystemPartition" ).toString(); = Calamares::JobQueue::instance()->globalStorage()->value( "efiSystemPartition" ).toString();
#ifdef WITH_KPMCORE4API
const auto espFlag = PartitionTable::Flag::Boot;
#else
const auto espFlag = PartitionTable::FlagEsp;
#endif
Partition* esp = m_core->findPartitionByMountPoint( espMountPoint ); Partition* esp = m_core->findPartitionByMountPoint( espMountPoint );
QString message; QString message;
@ -567,7 +562,7 @@ PartitionViewStep::onLeave()
cDebug() << o << "ESP missing flag"; cDebug() << o << "ESP missing flag";
description.append( ' ' ); description.append( ' ' );
description.append( tr( "The filesystem must have flag <strong>%1</strong> set." ) description.append( tr( "The filesystem must have flag <strong>%1</strong> set." )
.arg( PartitionTable::flagName( espFlag ) ) ); .arg( PartitionTable::flagName( PartitionTable::Flag::Boot ) ) );
} }
if ( !description.isEmpty() ) if ( !description.isEmpty() )
{ {

View File

@ -127,11 +127,7 @@ getDevices( DeviceType which )
cWarning() << "No KPM backend found."; cWarning() << "No KPM backend found.";
return {}; return {};
} }
#if defined( WITH_KPMCORE4API )
DeviceList devices = backend->scanDevices( /* not includeReadOnly, not includeLoopback */ ScanFlag( 0 ) ); DeviceList devices = backend->scanDevices( /* not includeReadOnly, not includeLoopback */ ScanFlag( 0 ) );
#else
DeviceList devices = backend->scanDevices( /* excludeReadOnly */ true );
#endif
/* The list of devices is cleaned up for use: /* The list of devices is cleaned up for use:
* - some devices can **never** be used (e.g. floppies, nullptr) * - some devices can **never** be used (e.g. floppies, nullptr)

View File

@ -27,15 +27,10 @@ class Partition;
class PartitionNode; class PartitionNode;
class PartitionRole; class PartitionRole;
#if defined( WITH_KPMCORE4API ) // TODO:3.3: Remove defines, expand in-place
#define KPM_PARTITION_FLAG( x ) PartitionTable::Flag::x #define KPM_PARTITION_FLAG( x ) PartitionTable::Flag::x
#define KPM_PARTITION_STATE( x ) Partition::State::x #define KPM_PARTITION_STATE( x ) Partition::State::x
#define KPM_PARTITION_FLAG_ESP PartitionTable::Flag::Boot #define KPM_PARTITION_FLAG_ESP PartitionTable::Flag::Boot
#else
#define KPM_PARTITION_FLAG( x ) PartitionTable::Flag##x
#define KPM_PARTITION_STATE( x ) Partition::State##x
#define KPM_PARTITION_FLAG_ESP PartitionTable::FlagEsp
#endif
/** /**
* Helper functions to manipulate partitions * Helper functions to manipulate partitions

View File

@ -457,9 +457,7 @@ isEfiFilesystemSuitableType( const Partition* candidate )
{ {
case FileSystem::Type::Fat32: case FileSystem::Type::Fat32:
return true; return true;
#ifdef WITH_KPMCORE4API
case FileSystem::Type::Fat12: case FileSystem::Type::Fat12:
#endif
case FileSystem::Type::Fat16: case FileSystem::Type::Fat16:
cWarning() << "FAT12 and FAT16 are probably not supported by EFI"; cWarning() << "FAT12 and FAT16 are probably not supported by EFI";
return false; return false;
@ -496,31 +494,9 @@ isEfiBootable( const Partition* candidate )
{ {
const auto flags = PartitionInfo::flags( candidate ); const auto flags = PartitionInfo::flags( candidate );
#if defined( WITH_KPMCORE4API )
// In KPMCore4, the flags are remapped, and the ESP flag is the same as Boot. // In KPMCore4, the flags are remapped, and the ESP flag is the same as Boot.
static_assert( KPM_PARTITION_FLAG_ESP == KPM_PARTITION_FLAG( Boot ), "KPMCore API enum changed" ); static_assert( KPM_PARTITION_FLAG_ESP == KPM_PARTITION_FLAG( Boot ), "KPMCore API enum changed" );
return flags.testFlag( KPM_PARTITION_FLAG_ESP ); return flags.testFlag( KPM_PARTITION_FLAG_ESP );
#else
// In KPMCore3, bit 17 is the old-style Esp flag, and it's OK
if ( flags.testFlag( KPM_PARTITION_FLAG_ESP ) )
{
return true;
}
/* Otherwise, if it's a GPT table, Boot (bit 0) is the same as Esp */
const PartitionTable* table = CalamaresUtils::Partition::getPartitionTable( candidate );
if ( !table )
{
cWarning() << "Root of partition table is not a PartitionTable object";
return false;
}
if ( table->type() == PartitionTable::TableType::gpt )
{
const auto bootFlag = KPM_PARTITION_FLAG( Boot );
return flags.testFlag( bootFlag );
}
return false;
#endif
} }
// TODO: this is configurable via the config file **already** // TODO: this is configurable via the config file **already**

View File

@ -847,13 +847,8 @@ PartitionCoreModule::scanForLVMPVs()
} }
} }
#if defined( WITH_KPMCORE4API )
VolumeManagerDevice::scanDevices( physicalDevices ); VolumeManagerDevice::scanDevices( physicalDevices );
for ( auto p : LVM::pvList::list() ) for ( auto p : LVM::pvList::list() )
#else
LvmDevice::scanSystemLVM( physicalDevices );
for ( auto p : LVM::pvList )
#endif
{ {
m_lvmPVs << p.partition().data(); m_lvmPVs << p.partition().data();
@ -890,7 +885,6 @@ PartitionCoreModule::scanForLVMPVs()
m_lvmPVs << p; m_lvmPVs << p;
} }
} }
#if defined( WITH_KPMCORE4API )
else if ( p->fileSystem().type() == FileSystem::Type::Luks2 ) else if ( p->fileSystem().type() == FileSystem::Type::Luks2 )
{ {
// Encrypted LVM PVs // Encrypted LVM PVs
@ -901,7 +895,6 @@ PartitionCoreModule::scanForLVMPVs()
m_lvmPVs << p; m_lvmPVs << p;
} }
} }
#endif
} }
} }
} }

View File

@ -154,11 +154,9 @@ PartitionLayout::setDefaultFsType( FileSystem::Type defaultFsType )
case FileSystem::Lvm2_PV: case FileSystem::Lvm2_PV:
case FileSystem::Udf: case FileSystem::Udf:
case FileSystem::Iso9660: case FileSystem::Iso9660:
#ifdef WITH_KPMCORE4API
case FileSystem::Luks2: case FileSystem::Luks2:
case FileSystem::LinuxRaidMember: case FileSystem::LinuxRaidMember:
case FileSystem::BitLocker: case FileSystem::BitLocker:
#endif
// bad bad // bad bad
cWarning() << "The selected default FS" << defaultFsType << "is not suitable." cWarning() << "The selected default FS" << defaultFsType << "is not suitable."
<< "Using ext4 instead."; << "Using ext4 instead.";
@ -185,11 +183,9 @@ PartitionLayout::setDefaultFsType( FileSystem::Type defaultFsType )
case FileSystem::Hpfs: case FileSystem::Hpfs:
case FileSystem::Zfs: case FileSystem::Zfs:
case FileSystem::Nilfs2: case FileSystem::Nilfs2:
#ifdef WITH_KPMCORE4API
case FileSystem::Fat12: case FileSystem::Fat12:
case FileSystem::Apfs: case FileSystem::Apfs:
case FileSystem::Minix: case FileSystem::Minix:
#endif
// weird // weird
cWarning() << "The selected default FS" << defaultFsType << "is unusual, but not wrong."; cWarning() << "The selected default FS" << defaultFsType << "is unusual, but not wrong.";
break; break;
@ -355,30 +351,18 @@ PartitionLayout::createPartitions( Device* dev,
} }
if ( !entry.partType.isEmpty() ) if ( !entry.partType.isEmpty() )
{ {
#if defined( WITH_KPMCORE42API )
part->setType( entry.partType ); part->setType( entry.partType );
#else
cWarning() << "Ignoring type; requires KPMcore >= 4.2.0.";
#endif
} }
if ( entry.partAttributes ) if ( entry.partAttributes )
{ {
#if defined( WITH_KPMCORE42API )
part->setAttributes( entry.partAttributes ); part->setAttributes( entry.partAttributes );
#else
cWarning() << "Ignoring attributes; requires KPMcore >= 4.2.0.";
#endif
} }
if ( !entry.partFeatures.isEmpty() ) if ( !entry.partFeatures.isEmpty() )
{ {
#if defined( WITH_KPMCORE42API )
for ( const auto& k : entry.partFeatures.keys() ) for ( const auto& k : entry.partFeatures.keys() )
{ {
part->fileSystem().addFeature( k, entry.partFeatures.value( k ) ); part->fileSystem().addFeature( k, entry.partFeatures.value( k ) );
} }
#else
cWarning() << "Ignoring features; requires KPMcore >= 4.2.0.";
#endif
} }
// Some buggy (legacy) BIOSes test if the bootflag of at least one partition is set. // Some buggy (legacy) BIOSes test if the bootflag of at least one partition is set.
// Otherwise they ignore the device in boot-order, so add it here. // Otherwise they ignore the device in boot-order, so add it here.

View File

@ -42,9 +42,7 @@
#include "widgets/PrettyRadioButton.h" #include "widgets/PrettyRadioButton.h"
#include <kpmcore/core/device.h> #include <kpmcore/core/device.h>
#ifdef WITH_KPMCORE4API
#include <kpmcore/core/softwareraid.h> #include <kpmcore/core/softwareraid.h>
#endif
#include <QBoxLayout> #include <QBoxLayout>
#include <QButtonGroup> #include <QButtonGroup>
@ -1344,14 +1342,12 @@ ChoicePage::setupActions()
bool isInactiveRAID = false; bool isInactiveRAID = false;
bool matchTableType = false; bool matchTableType = false;
#ifdef WITH_KPMCORE4API
if ( currentDevice->type() == Device::Type::SoftwareRAID_Device if ( currentDevice->type() == Device::Type::SoftwareRAID_Device
&& static_cast< SoftwareRAID* >( currentDevice )->status() == SoftwareRAID::Status::Inactive ) && static_cast< SoftwareRAID* >( currentDevice )->status() == SoftwareRAID::Status::Inactive )
{ {
cDebug() << Logger::SubEntry << "part of an inactive RAID device"; cDebug() << Logger::SubEntry << "part of an inactive RAID device";
isInactiveRAID = true; isInactiveRAID = true;
} }
#endif
PartitionTable::TableType tableType = PartitionTable::unknownTableType; PartitionTable::TableType tableType = PartitionTable::unknownTableType;
if ( currentDevice->partitionTable() ) if ( currentDevice->partitionTable() )

View File

@ -100,9 +100,7 @@ DeviceInfoWidget::retranslateUi()
"that makes a file accessible as a block device. " "that makes a file accessible as a block device. "
"This kind of setup usually only contains a single filesystem." ); "This kind of setup usually only contains a single filesystem." );
break; break;
#if defined( WITH_KPMCORE42API )
case PartitionTable::none: case PartitionTable::none:
#endif
case PartitionTable::unknownTableType: case PartitionTable::unknownTableType:
typeString = " ? "; typeString = " ? ";
toolTipString = tr( "This installer <strong>cannot detect a partition table</strong> on the " toolTipString = tr( "This installer <strong>cannot detect a partition table</strong> on the "

View File

@ -42,9 +42,7 @@
// KPMcore // KPMcore
#include <kpmcore/core/device.h> #include <kpmcore/core/device.h>
#include <kpmcore/core/partition.h> #include <kpmcore/core/partition.h>
#ifdef WITH_KPMCORE4API
#include <kpmcore/core/softwareraid.h> #include <kpmcore/core/softwareraid.h>
#endif
#include <kpmcore/ops/deactivatevolumegroupoperation.h> #include <kpmcore/ops/deactivatevolumegroupoperation.h>
#include <kpmcore/ops/removevolumegroupoperation.h> #include <kpmcore/ops/removevolumegroupoperation.h>
@ -179,14 +177,12 @@ PartitionPage::updateButtons()
{ {
allow_create_table = true; allow_create_table = true;
#ifdef WITH_KPMCORE4API
if ( device->type() == Device::Type::SoftwareRAID_Device if ( device->type() == Device::Type::SoftwareRAID_Device
&& static_cast< SoftwareRAID* >( device )->status() == SoftwareRAID::Status::Inactive ) && static_cast< SoftwareRAID* >( device )->status() == SoftwareRAID::Status::Inactive )
{ {
allow_create_table = false; allow_create_table = false;
allow_create = false; allow_create = false;
} }
#endif
} }
else else
{ {

View File

@ -111,7 +111,6 @@ CreatePartitionJob::CreatePartitionJob( Device* device, Partition* partition )
static QString static QString
prettyGptType( const Partition* partition ) prettyGptType( const Partition* partition )
{ {
#ifdef WITH_KPMCORE42API
static const QMap< QString, QString > gptTypePrettyStrings = { static const QMap< QString, QString > gptTypePrettyStrings = {
{ "44479540-f297-41b2-9af7-d131d5f0458a", "Linux Root Partition (x86)" }, { "44479540-f297-41b2-9af7-d131d5f0458a", "Linux Root Partition (x86)" },
{ "4f68bce3-e8cd-4db1-96e7-fbcaf984b709", "Linux Root Partition (x86-64)" }, { "4f68bce3-e8cd-4db1-96e7-fbcaf984b709", "Linux Root Partition (x86-64)" },
@ -146,9 +145,6 @@ prettyGptType( const Partition* partition )
auto type = partition->type(); auto type = partition->type();
return gptTypePrettyStrings.value( type.toLower(), type ); return gptTypePrettyStrings.value( type.toLower(), type );
#else
return QString();
#endif
} }
static QString static QString

View File

@ -88,11 +88,9 @@ mapForPartition( Partition* partition, const QString& uuid )
map[ "mountPoint" ] = PartitionInfo::mountPoint( partition ); map[ "mountPoint" ] = PartitionInfo::mountPoint( partition );
map[ "fsName" ] = userVisibleFS( partition->fileSystem() ); map[ "fsName" ] = userVisibleFS( partition->fileSystem() );
map[ "fs" ] = untranslatedFS( partition->fileSystem() ); map[ "fs" ] = untranslatedFS( partition->fileSystem() );
#ifdef WITH_KPMCORE42API
map[ "parttype" ] = partition->type(); map[ "parttype" ] = partition->type();
map[ "partattrs" ] = partition->attributes(); map[ "partattrs" ] = partition->attributes();
map[ "features" ] = partition->fileSystem().features(); map[ "features" ] = partition->fileSystem().features();
#endif
if ( partition->fileSystem().type() == FileSystem::Luks if ( partition->fileSystem().type() == FileSystem::Luks
&& dynamic_cast< FS::luks& >( partition->fileSystem() ).innerFS() ) && dynamic_cast< FS::luks& >( partition->fileSystem() ).innerFS() )
{ {

View File

@ -125,7 +125,6 @@ CreateLayoutsTests::testMixedSizePartition()
QCOMPARE( partitions[ 2 ]->length(), ( ( 5_GiB - 5_MiB ) / 2 ) / LOGICAL_SIZE ); QCOMPARE( partitions[ 2 ]->length(), ( ( 5_GiB - 5_MiB ) / 2 ) / LOGICAL_SIZE );
} }
#ifdef WITH_KPMCORE4API
// TODO: Get a clean way to instantiate a test Device from KPMCore // TODO: Get a clean way to instantiate a test Device from KPMCore
class DevicePrivate class DevicePrivate
{ {
@ -150,11 +149,5 @@ TestDevice::TestDevice( const QString& name, const qint64 logicalSectorSize, con
Device::Type::Unknown_Device ) Device::Type::Unknown_Device )
{ {
} }
#else
TestDevice::TestDevice( const QString& name, const qint64 logicalSectorSize, const qint64 totalLogicalSectors )
: Device( name, QString( "node" ), logicalSectorSize, totalLogicalSectors, QString(), Device::Type::Unknown_Device )
{
}
#endif
TestDevice::~TestDevice() {} TestDevice::~TestDevice() {}

View File

@ -52,12 +52,7 @@ DevicesTests::testKPMScanDevices()
cDebug() << "Getting devices via KPMCore"; cDebug() << "Getting devices via KPMCore";
CoreBackend* backend = CoreBackendManager::self()->backend(); CoreBackend* backend = CoreBackendManager::self()->backend();
QVERIFY( backend ); QVERIFY( backend );
#if defined( WITH_KPMCORE4API ) auto devices = backend->scanDevices( ScanFlag( ~0 ) ); // These flags try to get "all"
auto flags = ScanFlag( ~0 );
#else
auto flags = true;
#endif
auto devices = backend->scanDevices( flags ); // These flags try to get "all"
cDebug() << Logger::SubEntry << "Done getting devices."; cDebug() << Logger::SubEntry << "Done getting devices.";
if ( !m_isRoot ) if ( !m_isRoot )