From 40f39bdbe27cb390b86de7ef79c6b9f8aab5623e Mon Sep 17 00:00:00 2001 From: Mike Fleetwood Date: Fri, 3 Jun 2016 09:18:21 +0100 Subject: [PATCH] Rename Partition::add_path() to set_path() (#767842) To reflect that there is now only a single path in the Partition object now. Also get rid of the now unneeded optional clear_paths parameter which was only relevant when there was a vector of paths. Bug 767842 - File system usage missing when tools report alternate block device names --- include/Partition.h | 2 +- src/GParted_Core.cc | 11 ++++------- src/Partition.cc | 2 +- src/Win_GParted.cc | 5 ++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/Partition.h b/include/Partition.h index 2a7cbdee..bc2aabb0 100644 --- a/include/Partition.h +++ b/include/Partition.h @@ -101,7 +101,7 @@ public: //update partition number (used when a logical partition is deleted) void Update_Number( int new_number ); - void add_path( const Glib::ustring & path, bool clear_paths = false ) ; + void set_path( const Glib::ustring & path ); Byte_Value get_byte_length() const ; Sector get_sector_length() const ; Glib::ustring get_path() const ; diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 35378605..8fbdf8cc 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -761,8 +761,7 @@ bool GParted_Core::apply_operation_to_disk( Operation * operation ) // case the path is "Copy of ..." from the partition having been // newly created by a paste into unallocated space earlier in the // sequence of operations now being applied. - operation->get_partition_new().add_path( operation->get_partition_original().get_path(), - true ); + operation->get_partition_new().set_path( operation->get_partition_original().get_path() ); success = resize_move( operation->get_partition_original(), operation->get_partition_new(), @@ -778,8 +777,7 @@ bool GParted_Core::apply_operation_to_disk( Operation * operation ) // calibration in case the path is "Copy of ..." from the // partition having been newly created by a paste into unallocated // space earlier in the sequence of operations now being applied. - operation->get_partition_original().add_path( operation->get_partition_new().get_path(), - true ); + operation->get_partition_original().set_path( operation->get_partition_new().get_path() ); success = remove_filesystem( operation->get_partition_original(), operation->operation_detail ) @@ -2191,8 +2189,7 @@ bool GParted_Core::create_partition( Partition & new_partition, OperationDetail if ( ped_disk_add_partition( lp_disk, lp_partition, constraint ) && commit( lp_disk ) ) { - Glib::ustring partition_path = get_partition_path( lp_partition ) ; - new_partition .add_path( partition_path, true ) ; + new_partition.set_path( get_partition_path( lp_partition ) ); new_partition .partition_number = lp_partition ->num ; new_partition .sector_start = lp_partition ->geom .start ; @@ -3484,7 +3481,7 @@ bool GParted_Core::calibrate_partition( Partition & partition, OperationDetail & // additional operations such mkfs for the format // operation or fsck and others for the // resize/move operation. - partition.add_path( get_partition_path( lp_partition ) ); + partition.set_path( get_partition_path( lp_partition ) ); } // Reload the partition boundaries from libparted diff --git a/src/Partition.cc b/src/Partition.cc index 6481aac6..17d6d3bf 100644 --- a/src/Partition.cc +++ b/src/Partition.cc @@ -198,7 +198,7 @@ void Partition::Update_Number( int new_number ) partition_number = new_number; } -void Partition::add_path( const Glib::ustring & path, bool clear_paths ) +void Partition::set_path( const Glib::ustring & path ) { this->path = path; } diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index 26d203da..e921b75e 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -1861,10 +1861,9 @@ void Win_GParted::activate_paste() // path of "Copy of /dev/SRC" for display purposes until // the partition is created and the real path queried. OperationCopy * copy_op = static_cast( operation ); - copy_op->get_partition_new().add_path( + copy_op->get_partition_new().set_path( String::ucompose( _("Copy of %1"), - copy_op->get_partition_copied().get_path() ), - true ); + copy_op->get_partition_copied().get_path() ) ); Add_Operation( operation ) ; }