From ee08938ceacc1a1414127b590efe7caf10c2b30b Mon Sep 17 00:00:00 2001 From: Volker Lanz Date: Wed, 1 Oct 2008 23:54:20 +0000 Subject: [PATCH] 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 --- src/core/partition.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/partition.cpp b/src/core/partition.cpp index 44fc816..6cf8fda 100644 --- a/src/core/partition.cpp +++ b/src/core/partition.cpp @@ -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;