Don't enable unmounting for extended partitions if a child partition is

mounted.

Don't silently succeed when unmounting a partition that cannot in fact be
unmounted because it has no mount points.

svn path=/trunk/playground/sysadmin/partitionmanager/; revision=866824
This commit is contained in:
Volker Lanz 2008-10-01 23:54:20 +00:00
parent 2084e004c4
commit ee08938cea
1 changed files with 2 additions and 2 deletions

View File

@ -270,7 +270,7 @@ bool Partition::canMount() const
/** @return true if this Partition can be unmounted */
bool Partition::canUnmount() const
{
return isMounted();
return !roles().has(PartitionRole::Extended) && isMounted();
}
/** Tries to mount a Partition.
@ -305,7 +305,7 @@ bool Partition::mount()
*/
bool Partition::unmount()
{
if (!isMounted())
if (!isMounted() || mountPoints().size() == 0)
return false;
bool success = true;