[partition] Avoid KPMCore warnings
- Get ready for KPMCore post-3.3.0, which deprecates a bunch of Flag<foo> and State<foo> in preparation of enum classes.
This commit is contained in:
parent
5d6d2b8078
commit
2a2795c54c
@ -67,7 +67,7 @@ isPartitionFreeSpace( Partition* partition )
|
||||
bool
|
||||
isPartitionNew( Partition* partition )
|
||||
{
|
||||
return partition->state() == Partition::StateNew;
|
||||
return partition->state() == KPM_PARTITION_STATE(New);
|
||||
}
|
||||
|
||||
|
||||
@ -127,11 +127,11 @@ createNewPartition( PartitionNode* parent,
|
||||
role,
|
||||
fs, fs->firstSector(), fs->lastSector(),
|
||||
QString() /* path */,
|
||||
PartitionTable::FlagNone /* availableFlags */,
|
||||
KPM_PARTITION_FLAG(None) /* availableFlags */,
|
||||
QString() /* mountPoint */,
|
||||
false /* mounted */,
|
||||
flags /* activeFlags */,
|
||||
Partition::StateNew
|
||||
KPM_PARTITION_STATE(New)
|
||||
);
|
||||
}
|
||||
|
||||
@ -169,11 +169,11 @@ createNewEncryptedPartition( PartitionNode* parent,
|
||||
PartitionRole( newRoles ),
|
||||
fs, fs->firstSector(), fs->lastSector(),
|
||||
QString() /* path */,
|
||||
PartitionTable::FlagNone /* availableFlags */,
|
||||
KPM_PARTITION_FLAG(None) /* availableFlags */,
|
||||
QString() /* mountPoint */,
|
||||
false /* mounted */,
|
||||
flags /* activeFlags */,
|
||||
Partition::StateNew );
|
||||
KPM_PARTITION_STATE(New) );
|
||||
return p;
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,14 @@ class Partition;
|
||||
class PartitionNode;
|
||||
class PartitionRole;
|
||||
|
||||
#ifdef WITH_KPMCOREGT33
|
||||
#define KPM_PARTITION_FLAG(x) PartitionTable::Flag::x
|
||||
#define KPM_PARTITION_STATE(x) Partition::State::x
|
||||
#else
|
||||
#define KPM_PARTITION_FLAG(x) PartitionTable::Flag##x
|
||||
#define KPM_PARTITION_STATE(x) Partition::State##x
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Helper functions to manipulate partitions
|
||||
*/
|
||||
|
@ -425,7 +425,7 @@ isEfiBootable( const Partition* candidate )
|
||||
const PartitionTable* table = dynamic_cast<const PartitionTable*>( root );
|
||||
cDebug() << " .. partition table" << (void *)table << "type" << ( table ? table->type() : PartitionTable::TableType::unknownTableType );
|
||||
return table && ( table->type() == PartitionTable::TableType::gpt ) &&
|
||||
flags.testFlag( PartitionTable::FlagBoot );
|
||||
flags.testFlag( KPM_PARTITION_FLAG(Boot) );
|
||||
}
|
||||
|
||||
QString
|
||||
|
@ -129,7 +129,7 @@ doAutopartition( PartitionCoreModule* core, Device* dev, Choices::AutoPartitionO
|
||||
FileSystem::Fat32,
|
||||
firstFreeSector,
|
||||
lastSector,
|
||||
PartitionTable::FlagNone
|
||||
KPM_PARTITION_FLAG(None)
|
||||
);
|
||||
PartitionInfo::setFormat( efiPartition, true );
|
||||
PartitionInfo::setMountPoint( efiPartition, o.efiPartitionMountPoint );
|
||||
@ -178,7 +178,7 @@ doAutopartition( PartitionCoreModule* core, Device* dev, Choices::AutoPartitionO
|
||||
FileSystem::LinuxSwap,
|
||||
lastSectorForRoot + 1,
|
||||
dev->totalLogical() - 1,
|
||||
PartitionTable::FlagNone
|
||||
KPM_PARTITION_FLAG(None)
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -191,7 +191,7 @@ doAutopartition( PartitionCoreModule* core, Device* dev, Choices::AutoPartitionO
|
||||
lastSectorForRoot + 1,
|
||||
dev->totalLogical() - 1,
|
||||
o.luksPassphrase,
|
||||
PartitionTable::FlagNone
|
||||
KPM_PARTITION_FLAG(None)
|
||||
);
|
||||
}
|
||||
PartitionInfo::setFormat( swapPartition, true );
|
||||
|
@ -299,7 +299,7 @@ PartitionCoreModule::createPartition( Device* device,
|
||||
|
||||
deviceInfo->jobs << Calamares::job_ptr( job );
|
||||
|
||||
if ( flags != PartitionTable::FlagNone )
|
||||
if ( flags != KPM_PARTITION_FLAG(None) )
|
||||
{
|
||||
SetPartFlagsJob* fJob = new SetPartFlagsJob( device, partition, flags );
|
||||
deviceInfo->jobs << Calamares::job_ptr( fJob );
|
||||
@ -401,7 +401,7 @@ PartitionCoreModule::deletePartition( Device* device, Partition* partition )
|
||||
}
|
||||
|
||||
QList< Calamares::job_ptr >& jobs = deviceInfo->jobs;
|
||||
if ( partition->state() == Partition::StateNew )
|
||||
if ( partition->state() == KPM_PARTITION_STATE(New) )
|
||||
{
|
||||
// First remove matching SetPartFlagsJobs
|
||||
for ( auto it = jobs.begin(); it != jobs.end(); )
|
||||
@ -832,7 +832,7 @@ PartitionCoreModule::layoutApply( Device *dev,
|
||||
if ( part->mountPoint() == "/" )
|
||||
{
|
||||
createPartition( dev, part,
|
||||
part->activeFlags() | ( isEfi ? PartitionTable::FlagNone : PartitionTable::FlagBoot )
|
||||
part->activeFlags() | ( isEfi ? KPM_PARTITION_FLAG(None) : KPM_PARTITION_FLAG(Boot) )
|
||||
);
|
||||
}
|
||||
else
|
||||
|
@ -20,6 +20,7 @@
|
||||
#ifndef PARTITIONCOREMODULE_H
|
||||
#define PARTITIONCOREMODULE_H
|
||||
|
||||
#include "core/KPMHelpers.h"
|
||||
#include "core/PartitionLayout.h"
|
||||
#include "core/PartitionModel.h"
|
||||
#include "Typedefs.h"
|
||||
@ -136,7 +137,7 @@ public:
|
||||
* applied to the newly-created partition.
|
||||
*/
|
||||
void createPartition( Device* device, Partition* partition,
|
||||
PartitionTable::Flags flags = PartitionTable::FlagNone );
|
||||
PartitionTable::Flags flags = KPM_PARTITION_FLAG(None) );
|
||||
|
||||
void createVolumeGroup( QString &vgName, QVector< const Partition* > pvList, qint32 peSize );
|
||||
|
||||
|
@ -143,7 +143,7 @@ PartitionLayout::execute( Device *dev, qint64 firstSector,
|
||||
part.partFileSystem,
|
||||
firstSector,
|
||||
end,
|
||||
PartitionTable::FlagNone
|
||||
KPM_PARTITION_FLAG(None)
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -156,7 +156,7 @@ PartitionLayout::execute( Device *dev, qint64 firstSector,
|
||||
firstSector,
|
||||
end,
|
||||
luksPassphrase,
|
||||
PartitionTable::FlagNone
|
||||
KPM_PARTITION_FLAG(None)
|
||||
);
|
||||
}
|
||||
PartitionInfo::setFormat( currentPartition, true );
|
||||
|
@ -154,7 +154,7 @@ ReplaceWidget::onPartitionSelected()
|
||||
|
||||
Partition* partition = model->partitionForIndex( m_ui->partitionTreeView->currentIndex() );
|
||||
if ( !partition ||
|
||||
partition->state() != Partition::StateNone )
|
||||
partition->state() != KPM_PARTITION_STATE(None) )
|
||||
{
|
||||
updateStatus( CalamaresUtils::Fail,
|
||||
tr( "The selected item does not appear to be a valid partition." ) );
|
||||
|
@ -228,11 +228,11 @@ PartitionJobTests::newCreatePartitionJob( Partition* freeSpacePartition, Partiti
|
||||
role,
|
||||
fs, firstSector, lastSector,
|
||||
QString() /* path */,
|
||||
PartitionTable::FlagNone /* availableFlags */,
|
||||
KPM_PARTITION_FLAG(None) /* availableFlags */,
|
||||
QString() /* mountPoint */,
|
||||
false /* mounted */,
|
||||
PartitionTable::FlagNone /* activeFlags */,
|
||||
Partition::StateNew
|
||||
KPM_PARTITION_FLAG(None) /* activeFlags */,
|
||||
KPM_PARTITION_STATE(New)
|
||||
);
|
||||
return new CreatePartitionJob( m_device.data(), partition );
|
||||
}
|
||||
@ -366,7 +366,7 @@ PartitionJobTests::testResizePartition()
|
||||
FileSystem::Ext4,
|
||||
oldFirst,
|
||||
oldLast,
|
||||
PartitionTable::FlagNone
|
||||
KPM_PARTITION_FLAG(None)
|
||||
);
|
||||
CreatePartitionJob* job = new CreatePartitionJob( m_device.data(), partition );
|
||||
job->updatePreview();
|
||||
|
Loading…
Reference in New Issue
Block a user