[gparted] Report either partition or device in operational results (#743181)



commit 84eb35b7eb15964a188cbdd1f17a33143ea0ec21
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sun Feb 8 21:36:33 2015 +0000

    Report either partition or device in operational results (#743181)
    
    In the operational results of the calibrate step include the type of the
    path GParted is working with, either partition or whole disk device.  Do
    the same for the create empty partition step too for consistency, even
    though it only ever creates partitions.  Looks like:
    
        create empty partition
          path: /dev/sdb3 (partition)
          start: 2099200
          end: 4196351
          size: 2097152 (1.00 GiB)
    
        calibrate /dev/sdc
          path: /dev/sdc (device)
          start: 0
          end: 1953525167
          size: 1953525168 (931.51 GiB)
    
    Makes it explicit to the users what GParted has detected.  Helps the
    developers when looking at saved results to understand what decisions
    were made and why specific steps were performed or not.
    
    Bug 743181 - Add unpartitioned drive read-write support

 src/GParted_Core.cc |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index 1d0848b..ca09f06 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -1988,7 +1988,12 @@ bool GParted_Core::create_partition( Partition & new_partition, OperationDetail
                                        new_partition .sector_end = lp_partition ->geom .end ;
                                        
                                        operationdetail .get_last_child() .add_child( OperationDetail( 
-                                               String::ucompose( _("path: %1"), new_partition .get_path() ) 
+ "\n" +
+                                               /* TO TRANSLATORS: looks like   path: /dev/sda1 (partition)
+                                                * This is showing the name and the fact
+                                                * that it is a partition within a device.
+                                                */
+                                               String::ucompose( _("path: %1 (%2)"),
+                                                                 new_partition.get_path(), _("partition") ) 
+ "\n" +
                                                String::ucompose( _("start: %1"), new_partition .sector_start 
) + "\n" +
                                                String::ucompose( _("end: %1"), new_partition .sector_end ) + 
"\n" +
                                                String::ucompose( _("size: %1 (%2)"),
@@ -3218,7 +3223,16 @@ bool GParted_Core::calibrate_partition( Partition & partition, OperationDetail &
                        {
                                operationdetail .get_last_child() .add_child( 
                                        OperationDetail(
-                                               String::ucompose( _("path: %1"), partition .get_path() ) + 
"\n" +
+                                               /* TO TRANSLATORS: looks like   path: /dev/sda (device)
+                                                *              or looks like   path: /dev/sda1 (partition)
+                                                * This is showing the name and whether it
+                                                * is a whole disk device or a partition
+                                                * within a device.
+                                                */
+                                               String::ucompose( _("path: %1 (%2)"),
+                                                                 partition.get_path(),
+                                                                 ( partition.whole_device ) ? _("device")
+                                                                                            : _("partition") 
) + "\n" +
                                                String::ucompose( _("start: %1"), partition .sector_start ) + 
"\n" +
                                                String::ucompose( _("end: %1"), partition .sector_end ) + 
"\n" +
                                                String::ucompose( _("size: %1 (%2)"),


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