A mounted partition cannot be resized or replaced

- add check for isMounted()
 - a device with a mounted partition cannot be (entirely) erased

FIXES #639
This commit is contained in:
Adriaan de Groot 2017-09-07 04:55:26 -04:00
parent 851379628c
commit 3e5916157f
2 changed files with 26 additions and 50 deletions

View file

@ -45,6 +45,9 @@ canBeReplaced( Partition* candidate )
if ( !candidate )
return false;
if ( candidate->isMounted() )
return false;
bool ok = false;
double requiredStorageGB = Calamares::JobQueue::instance()
->globalStorage()
@ -83,6 +86,9 @@ canBeResized( Partition* candidate )
if ( KPMHelpers::isPartitionFreeSpace( candidate ) )
return false;
if ( candidate->isMounted() )
return false;
if ( candidate->roles().has( PartitionRole::Primary ) )
{
PartitionTable* table = dynamic_cast< PartitionTable* >( candidate->parent() );