From 0aa49f3e98169098e37ba521f462803f19b0124a Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Sun, 3 Sep 2006 14:32:11 +0000 Subject: [PATCH] added progressfeedback to Delete() * src/GParted_Core.cc: added progressfeedback to Delete() --- ChangeLog | 4 ++++ src/GParted_Core.cc | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab83700c..5da50830 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-09-03 Bart Hakvoort + + * src/GParted_Core.cc: added progressfeedback to Delete() + 2006-09-03 Bart Hakvoort * include/GParted_Core.h, diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index f0cb401c..40e3d575 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -1023,21 +1023,23 @@ bool GParted_Core::format( const Partition & partition, OperationDetail & operat bool GParted_Core::Delete( const Partition & partition, OperationDetail & operationdetail ) { - bool return_value = false ; - + operationdetail .add_child( OperationDetail( _("delete partition") ) ) ; + + bool succes = false ; if ( open_device_and_disk( partition .device_path ) ) { - if ( partition .type == GParted::TYPE_EXTENDED ) + if ( partition .type == TYPE_EXTENDED ) lp_partition = ped_disk_extended_partition( lp_disk ) ; else lp_partition = ped_disk_get_partition_by_sector( lp_disk, partition .get_sector() ) ; - return_value = ped_disk_delete_partition( lp_disk, lp_partition ) && commit( partition .device_path ) ; + succes = ped_disk_delete_partition( lp_disk, lp_partition ) && commit( partition .device_path ) ; close_device_and_disk() ; } - return return_value ; + operationdetail .get_last_child() .set_status( succes ? STATUS_SUCCES : STATUS_ERROR ) ; + return succes ; } bool GParted_Core::resize_move( const Device & device, @@ -1138,7 +1140,7 @@ bool GParted_Core::move_filesystem( const Partition & partition_old, break ; } - operationdetail .get_last_child() .set_status( succes ? STATUS_SUCCES : STATUS_ERROR ) ; + operationdetail .get_last_child() .set_status( succes ? STATUS_SUCCES : STATUS_ERROR ) ; return succes ; }