From 90e1af5bfec155a79521c4077c45c27e7a5094cd Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Tue, 20 Jun 2006 20:17:32 +0000 Subject: [PATCH] finalized the order of operations when performing a move. * src/GParted_Core.cc: finalized the order of operations when performing a move. --- ChangeLog | 5 +++++ src/GParted_Core.cc | 26 +++++++++++++++----------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 457c1346..c16b2f33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-06-20 Bart Hakvoort + + * src/GParted_Core.cc: finalized the order of operations when + performing a move. + 2006-06-18 Bart Hakvoort * src/GParted_Core.cc: use new copy_block() in copy_filesystem() diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 513c9bad..7a689b5b 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -1031,21 +1031,22 @@ bool GParted_Core::move( const Device & device, Partition & partition_new, std::vector & operation_details ) { - //FIXME: look very carefully at this function and see where things (like checking and fsmaximizing) are //missing. if ( partition_new .get_length() > partition_old .get_length() ) { //first do the move Partition temp = partition_new ; temp .sector_end = partition_new .sector_start + partition_old .get_length() ; - if ( move_filesystem( partition_old, temp, operation_details ) ) + if ( check_repair( partition_old, operation_details ) && + move_filesystem( partition_old, temp, operation_details ) ) { //now move the partition - if ( resize_move_partition( partition_old, - temp, - false, - operation_details, - temp .get_length() ) ) + if ( check_repair( temp, operation_details ) && + resize_move_partition( partition_old, + temp, + false, + operation_details, + temp .get_length() ) ) { //now the partition and the filesystem are moved, we can grow it.. partition_new .sector_start = temp .sector_start ; @@ -1069,18 +1070,21 @@ bool GParted_Core::move( const Device & device, partition_new, false, operation_details, - partition_new .get_length() ) ; + partition_new .get_length() ) && + check_repair( partition_new, operation_details ) ; } return false ; } else - return move_filesystem( partition_old, partition_new, operation_details ) && + return check_repair( partition_old, operation_details ) && + move_filesystem( partition_old, partition_new, operation_details ) && resize_move_partition( partition_old, partition_new, false, operation_details, - partition_new .get_length() ) ; + partition_new .get_length() ) && + check_repair( partition_new, operation_details ) ; } bool GParted_Core::move_filesystem( const Partition & partition_old, @@ -1132,7 +1136,7 @@ bool GParted_Core::move_filesystem( const Partition & partition_old, } //we don't need disk anymore.. close_disk() ; - + //FIXME: only move is startsectors are different from each other... //do the move.. Sector blocksize = 32 ;//FIXME: write an algorithm to determine the optimal blocksize Glib::ustring error_message ;