|
|
@ -27,14 +27,14 @@ using ::Device;
|
|
|
|
using ::Partition;
|
|
|
|
using ::Partition;
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
bool
|
|
|
|
isPartitionFreeSpace( Partition* partition )
|
|
|
|
isPartitionFreeSpace( const Partition* partition )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return partition->roles().has( PartitionRole::Unallocated );
|
|
|
|
return partition->roles().has( PartitionRole::Unallocated );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
bool
|
|
|
|
isPartitionNew( Partition* partition )
|
|
|
|
isPartitionNew( const Partition* partition )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined( WITH_KPMCORE4API )
|
|
|
|
#if defined( WITH_KPMCORE4API )
|
|
|
|
constexpr auto NewState = Partition::State::New;
|
|
|
|
constexpr auto NewState = Partition::State::New;
|
|
|
@ -67,11 +67,15 @@ findPartitionByPath( const QList< Device* >& devices, const QString& path )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for ( auto device : devices )
|
|
|
|
for ( auto device : devices )
|
|
|
|
|
|
|
|
{
|
|
|
|
for ( auto it = PartitionIterator::begin( device ); it != PartitionIterator::end( device ); ++it )
|
|
|
|
for ( auto it = PartitionIterator::begin( device ); it != PartitionIterator::end( device ); ++it )
|
|
|
|
|
|
|
|
{
|
|
|
|
if ( ( *it )->partitionPath() == path.simplified() )
|
|
|
|
if ( ( *it )->partitionPath() == path.simplified() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return *it;
|
|
|
|
return *it;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -81,11 +85,15 @@ findPartitions( const QList< Device* >& devices, std::function< bool( Partition*
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QList< Partition* > results;
|
|
|
|
QList< Partition* > results;
|
|
|
|
for ( auto device : devices )
|
|
|
|
for ( auto device : devices )
|
|
|
|
|
|
|
|
{
|
|
|
|
for ( auto it = PartitionIterator::begin( device ); it != PartitionIterator::end( device ); ++it )
|
|
|
|
for ( auto it = PartitionIterator::begin( device ); it != PartitionIterator::end( device ); ++it )
|
|
|
|
|
|
|
|
{
|
|
|
|
if ( criterionFunction( *it ) )
|
|
|
|
if ( criterionFunction( *it ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
results.append( *it );
|
|
|
|
results.append( *it );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return results;
|
|
|
|
return results;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|