Include extended partitions in the count of active partitions

Trying to create a new partition table on a device with active
partitions reports the number of active partitions in the error dialog.
However when there is a busy logical partition the number of reported
busy partitions will be one less than the number of partitions in the
main UI showing the busy symbol.

GParted considers extended partitions as busy when any of the logical
partitions it contains as busy.  Display in the main UI reflects this.

Fix Win_GParted::active_partitions_on_device_count() to not exclude
extended partitions from the count.
This commit is contained in:
Mike Fleetwood 2016-08-19 12:16:30 +01:00 committed by Curtis Gedak
parent 253c4d6416
commit c6d29aa7e8
1 changed files with 1 additions and 2 deletions

View File

@ -2837,9 +2837,8 @@ int Win_GParted::active_partitions_on_device_count( const Device & device )
//Count the active partitions on the device
for ( unsigned int k=0; k < device .partitions .size(); k++ )
{
//Count the active primary partitions
// Count the active primary and extended partitions
if ( device .partitions[ k ] .busy
&& device .partitions[ k ] .type != TYPE_EXTENDED
&& device .partitions[ k ] .type != TYPE_UNALLOCATED
)
active_count++ ;