[gparted] Update partition related checks in set_valid_operations() (#788308)



commit 24123c4298f8b468ac94d2dd83d0c632a1555ab1
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Fri Aug 19 11:36:48 2016 +0100

    Update partition related checks in set_valid_operations() (#788308)
    
    Update the partition can be named and partition flags can be managed
    checks from being disallowed on unallocated partition types, to being
    allowed on primary, logical and extended partition types.  This is in
    preparation for the introduction of new unallocated partition type.
    
    Bug 788308 - Remove whole_device partition flag

 src/Win_GParted.cc |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc
index 56937ce..24e46f6 100644
--- a/src/Win_GParted.cc
+++ b/src/Win_GParted.cc
@@ -1124,16 +1124,20 @@ void Win_GParted::set_valid_operations()
           )
                allow_toggle_busy_state( true ) ;
 
-       // Allow naming on devices that support it
-       if ( selected_partition_ptr->type   != TYPE_UNALLOCATED   &&
-            selected_partition_ptr->status == STAT_REAL          &&
-            devices[current_device].partition_naming_supported()    )
+       // Allow partition naming on devices that support it
+       if ( selected_partition_ptr->status == STAT_REAL          &&
+            devices[current_device].partition_naming_supported() &&
+            ( selected_partition_ptr->type == TYPE_PRIMARY  ||
+              selected_partition_ptr->type == TYPE_LOGICAL  ||
+              selected_partition_ptr->type == TYPE_EXTENDED    )    )
                allow_name_partition( true );
 
-       // Manage flags
-       if ( selected_partition_ptr->type   != TYPE_UNALLOCATED &&
-            selected_partition_ptr->status == STAT_REAL        &&
-            ! selected_partition_ptr->whole_device                )
+       // Allow partition flag management
+       if ( selected_partition_ptr->status == STAT_REAL          &&
+            ! selected_partition_ptr->whole_device               &&
+            ( selected_partition_ptr->type == TYPE_PRIMARY  ||
+              selected_partition_ptr->type == TYPE_LOGICAL  ||
+              selected_partition_ptr->type == TYPE_EXTENDED    )    )
                allow_manage_flags( true );
 
 #ifdef ENABLE_ONLINE_RESIZE


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]