From 3bf218f8a0b0352f60aebf9d2716b63af54e52ef Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Fri, 8 Oct 2004 15:59:03 +0000 Subject: [PATCH] fixed some resizing-issues with reiserfs. * src/Dialog_Base_Partition.cc,src/Dialog_Partition_Resize_Move.cc: fixed some resizing-issues with reiserfs. --- ChangeLog | 5 +++++ src/Dialog_Base_Partition.cc | 15 ++++++++++++--- src/Dialog_Partition_Resize_Move.cc | 14 ++++++++------ 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 05c66667..2d086b84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-10-08 Bart Hakvoort + + * src/Dialog_Base_Partition.cc, + src/Dialog_Partition_Resize_Move.cc: fixed some resizing-issues with reiserfs. + 2004-10-07 Bart Hakvoort * src/Dialog_Base_Partition.cc, diff --git a/src/Dialog_Base_Partition.cc b/src/Dialog_Base_Partition.cc index 0d516527..8d7f0dd6 100644 --- a/src/Dialog_Base_Partition.cc +++ b/src/Dialog_Base_Partition.cc @@ -20,7 +20,7 @@ namespace GParted { -Dialog_Base_Partition::Dialog_Base_Partition( ) +Dialog_Base_Partition::Dialog_Base_Partition( ) { this ->set_has_separator( false ) ; @@ -147,7 +147,7 @@ void Dialog_Base_Partition::Set_Confirm_Button( CONFIRMBUTTON button_type ) { case NEW : this->add_button( Gtk::Stock::ADD,Gtk::RESPONSE_OK ); break ; - case RESIZE_MOVE: if ( selected_partition.filesystem == "ext2" || selected_partition.filesystem == "ext3" ) + case RESIZE_MOVE: if ( selected_partition.filesystem == "ext2" || selected_partition.filesystem == "ext3" || selected_partition.filesystem == "reiserfs") str_temp = _("Resize") ; else str_temp = _("Resize/Move") ; @@ -225,7 +225,16 @@ void Dialog_Base_Partition::on_signal_resize( int x_start, int x_end, Frame_Resi return ; } - + //check for lower limit reiserfs + if ( selected_partition.filesystem == "reiserfs" && ( x_end - x_start ) * MB_PER_PIXEL < 40 ) + { + frame_resizer_base ->set_x_start( this ->x_start ); + frame_resizer_base ->set_x_end( this ->x_end ); + + frame_resizer_base ->Draw_Partition() ; + GRIP = false ; + return ; + } spinbutton_size .set_value( ( x_end - x_start ) * MB_PER_PIXEL ) ; diff --git a/src/Dialog_Partition_Resize_Move.cc b/src/Dialog_Partition_Resize_Move.cc index 960eec7e..d73e47ef 100644 --- a/src/Dialog_Partition_Resize_Move.cc +++ b/src/Dialog_Partition_Resize_Move.cc @@ -63,7 +63,7 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vector set_title( String::ucompose( _("Resize %1"), selected_partition .partition) ) ; this ->fixed_start = true; @@ -85,8 +85,8 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vector = 1 && partitions[t -1].type == GParted::UNALLOCATED && selected_partition.filesystem != "ext2" && selected_partition.filesystem != "ext3" && partitions[t -1] .inside_extended == selected_partition.inside_extended ) + //also check the partitions filesystem ( if this is ext2/3 or reiserfs then previous should be 0 ) + if ( t >= 1 && partitions[t -1].type == GParted::UNALLOCATED && selected_partition.filesystem != "ext2" && selected_partition.filesystem != "ext3" && selected_partition.filesystem != "reiserfs" && partitions[t -1] .inside_extended == selected_partition.inside_extended ) { previous = partitions[t -1].sector_end - partitions[t -1].sector_start ; START = partitions[t -1].sector_start ; @@ -117,10 +117,12 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vector