@ -42,6 +42,25 @@
namespace PartUtils
{
static QString
convenienceName ( const Partition * const candidate )
{
if ( ! candidate - > mountPoint ( ) . isEmpty ( ) )
return candidate - > mountPoint ( ) ;
if ( ! candidate - > partitionPath ( ) . isEmpty ( ) )
return candidate - > partitionPath ( ) ;
if ( ! candidate - > devicePath ( ) . isEmpty ( ) )
return candidate - > devicePath ( ) ;
if ( ! candidate - > deviceNode ( ) . isEmpty ( ) )
return candidate - > devicePath ( ) ;
QString p ;
QTextStream s ( & p ) ;
s < < ( void * ) candidate ;
return p ;
}
bool
canBeReplaced ( Partition * candidate )
{
@ -63,12 +82,12 @@ canBeReplaced( Partition* candidate )
< < QString ( " (%1GB) " ) . arg ( requiredStorageB / 1024 / 1024 / 1024 ) ;
cDebug ( ) < < " Storage capacity B: " < < availableStorageB
< < QString ( " (%1GB) " ) . arg ( availableStorageB / 1024 / 1024 / 1024 )
< < " for " < < c andidate- > partitionPath ( ) < < " length: " < < candidate - > length ( ) ;
< < " for " < < c onvenienceName( candidate ) < < " length: " < < candidate - > length ( ) ;
if ( ok & &
availableStorageB > requiredStorageB )
{
cDebug ( ) < < " Partition " < < c andidate- > partitionPath ( ) < < " authorized for replace install. " ;
cDebug ( ) < < " Partition " < < c onvenienceName( candidate ) < < " authorized for replace install. " ;
return true ;
}
@ -85,7 +104,7 @@ canBeResized( Partition* candidate )
return false ;
}
cDebug ( ) < < " Checking if " < < c andidate- > partitionPath ( ) < < " can be resized. " ;
cDebug ( ) < < " Checking if " < < c onvenienceName( candidate ) < < " can be resized. " ;
if ( ! candidate - > fileSystem ( ) . supportGrow ( ) | |
! candidate - > fileSystem ( ) . supportShrink ( ) )
{
@ -139,13 +158,13 @@ canBeResized( Partition* candidate )
< < QString ( " (%1GB) " ) . arg ( advisedStorageGB ) ;
cDebug ( ) < < " Available storage B: " < < availableStorageB
< < QString ( " (%1GB) " ) . arg ( availableStorageB / 1024 / 1024 / 1024 )
< < " for " < < c andidate- > partitionPath ( ) < < " length: " < < candidate - > length ( )
< < " for " < < c onvenienceName( candidate ) < < " length: " < < candidate - > length ( )
< < " sectorsUsed: " < < candidate - > sectorsUsed ( ) < < " fsType: " < < candidate - > fileSystem ( ) . name ( ) ;
if ( ok & &
availableStorageB > advisedStorageB )
{
cDebug ( ) < < " Partition " < < c andidate- > partitionPath ( ) < < " authorized for resize + autopartition install. " ;
cDebug ( ) < < " Partition " < < c onvenienceName( candidate ) < < " authorized for resize + autopartition install. " ;
return true ;
}
@ -381,7 +400,7 @@ isEfiSystem()
bool
isEfiBootable ( const Partition * candidate )
{
cDebug ( ) < < " Check EFI bootable " < < c andidate- > partitionPath ( ) < < candidate - > devicePath ( ) ;
cDebug ( ) < < " Check EFI bootable " < < c onvenienceName( candidate ) < < candidate - > devicePath ( ) ;
cDebug ( ) < < " .. flags " < < candidate - > activeFlags ( ) ;
auto flags = PartitionInfo : : flags ( candidate ) ;