[gparted] Add device sector size to partition object



commit 4bcd0a37041d9a85dbe70947e39b38af48658bb2
Author: Curtis Gedak <gedakc gmail com>
Date:   Mon Apr 19 19:06:08 2010 -0600

    Add device sector size to partition object
    
    The device sector size is needed in all calculations that convert
    between sectors and bytes.  The device sector_size is included in
    the partition object because this object is used to contain
    operation information in addition to actual partitions and
    unallocated space.  A second option was considered to pass the
    device object to many methods, but this was considered a much
    larger task that might not provide significant gains in
    maintainability.

 include/Partition.h |    4 +++-
 src/Partition.cc    |    1 +
 2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/include/Partition.h b/include/Partition.h
index e368fce..ce070b1 100644
--- a/include/Partition.h
+++ b/include/Partition.h
@@ -115,7 +115,9 @@ public:
 
 	bool strict ;		//Indicator if start and end sectors must stay unchanged
 	bool strict_start ;	//Indicator if start sector must stay unchanged
-	
+
+	Byte_Value sector_size ;  //Sector size of the disk device needed for converting to/from sectors and bytes.
+
 private:
 	void sort_paths_and_remove_duplicates() ;
 
diff --git a/src/Partition.cc b/src/Partition.cc
index 3df0b35..33facd3 100644
--- a/src/Partition.cc
+++ b/src/Partition.cc
@@ -43,6 +43,7 @@ void Partition::Reset()
 	label .clear() ;
 	uuid .clear() ;
 	partition_number = sector_start = sector_end = sectors_used = sectors_unused = -1;
+	sector_size = 0 ;
 	color .set( "black" ) ;
 	inside_extended = busy = strict = strict_start = false ;
 	logicals .clear() ;



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