From 3703fd3783f45bcca96b802c3f279be6dcf1440a Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Wed, 15 Dec 2004 21:53:14 +0000 Subject: [PATCH] P ) * some minor internal codechanges, which should save a few bytes of mem here and there. (i was in a nitpicking mood :P ) --- ChangeLog | 5 +++++ include/Dialog_Base_Partition.h | 1 - include/Dialog_Partition_Copy.h | 2 +- include/Dialog_Partition_Resize_Move.h | 2 +- src/Dialog_Partition_Copy.cc | 6 ++---- src/Dialog_Partition_Resize_Move.cc | 5 ++--- src/Win_GParted.cc | 4 ++-- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50315e7e..c54de218 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-12-15 Bart Hakvoort + + * some minor internal codechanges, which should save a few bytes of mem here and there. + (i was in a nitpicking mood :P ) + 2004-12-15 Bart Hakvoort * Gparted_Core::get_fs now returns a const reference. diff --git a/include/Dialog_Base_Partition.h b/include/Dialog_Base_Partition.h index 0170bb41..df038ca0 100644 --- a/include/Dialog_Base_Partition.h +++ b/include/Dialog_Base_Partition.h @@ -77,7 +77,6 @@ protected: void on_signal_resize( int, int, Frame_Resizer_Base::ArrowType ); void on_spinbutton_value_changed( SPINBUTTON ) ; - std::vector FILESYSTEMS ; bool fixed_start, GRIP ; double before_value ; FS fs ; diff --git a/include/Dialog_Partition_Copy.h b/include/Dialog_Partition_Copy.h index 34f6f237..dd06e033 100644 --- a/include/Dialog_Partition_Copy.h +++ b/include/Dialog_Partition_Copy.h @@ -26,7 +26,7 @@ namespace GParted class Dialog_Partition_Copy : public Dialog_Base_Partition { public: - Dialog_Partition_Copy( std::vector FILESYSTEMS, Sector cylinder_size ) ; + Dialog_Partition_Copy( const FS & fs, Sector cylinder_size ) ; void Set_Data( const Partition & selected_partition, const Partition & copied_partition ); Partition Get_New_Partition( ) ; diff --git a/include/Dialog_Partition_Resize_Move.h b/include/Dialog_Partition_Resize_Move.h index 4c2ad0a0..fcf4702a 100644 --- a/include/Dialog_Partition_Resize_Move.h +++ b/include/Dialog_Partition_Resize_Move.h @@ -26,7 +26,7 @@ namespace GParted class Dialog_Partition_Resize_Move : public Dialog_Base_Partition { public: - Dialog_Partition_Resize_Move( std::vector FILESYSTEMS, Sector cylinder_size ) ; + Dialog_Partition_Resize_Move( const FS & fs, Sector cylinder_size ) ; void Set_Data( const Partition & selected_partition, const std::vector & partitions ) ; private: diff --git a/src/Dialog_Partition_Copy.cc b/src/Dialog_Partition_Copy.cc index 56b8b454..145bf4b5 100644 --- a/src/Dialog_Partition_Copy.cc +++ b/src/Dialog_Partition_Copy.cc @@ -20,9 +20,9 @@ namespace GParted { -Dialog_Partition_Copy::Dialog_Partition_Copy( std::vector FILESYSTEMS, Sector cylinder_size ) +Dialog_Partition_Copy::Dialog_Partition_Copy( const FS & fs, Sector cylinder_size ) { - this ->FILESYSTEMS = FILESYSTEMS ; + this ->fs = fs ; //some disk have a small cylindersize, for safetyreasons i keep this size at >=1 if ( cylinder_size < 2048 ) @@ -36,8 +36,6 @@ Dialog_Partition_Copy::Dialog_Partition_Copy( std::vector FILESYSTEMS, Secto void Dialog_Partition_Copy::Set_Data( const Partition & selected_partition, const Partition & copied_partition ) { - fs = Get_FS( copied_partition .filesystem, FILESYSTEMS ) ; - GRIP = true ; //prevents on spinbutton_changed from getting activated prematurely this ->set_title( String::ucompose( _("Paste %1"), copied_partition .partition ) ) ; diff --git a/src/Dialog_Partition_Resize_Move.cc b/src/Dialog_Partition_Resize_Move.cc index aa90c52d..0b4edc13 100644 --- a/src/Dialog_Partition_Resize_Move.cc +++ b/src/Dialog_Partition_Resize_Move.cc @@ -20,9 +20,9 @@ namespace GParted { -Dialog_Partition_Resize_Move::Dialog_Partition_Resize_Move( std::vector FILESYSTEMS, Sector cylinder_size ) +Dialog_Partition_Resize_Move::Dialog_Partition_Resize_Move( const FS & fs, Sector cylinder_size ) { - this ->FILESYSTEMS = FILESYSTEMS ; + this ->fs = fs ; //some disk have a small cylindersize, for safetyreasons i keep this size at >=1 if ( cylinder_size < 2048 ) @@ -64,7 +64,6 @@ void Dialog_Partition_Resize_Move::Set_Data( const Partition & selected_partitio void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vector & partitions ) { - fs = Get_FS( selected_partition .filesystem, FILESYSTEMS ) ; if ( ! selected_partition .error .empty( ) ) fs .shrink = false ; diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index 8b5e835e..931eef69 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -879,7 +879,7 @@ void Win_GParted::activate_resize() operations[ t ] .Apply_Operation_To_Visual( partitions ) ; - Dialog_Partition_Resize_Move dialog( gparted_core .get_fs( ), devices[ current_device ] .heads * devices[ current_device ] .sectors ) ; + Dialog_Partition_Resize_Move dialog( Get_FS( selected_partition .filesystem, gparted_core .get_fs( ) ), devices[ current_device ] .heads * devices[ current_device ] .sectors ) ; if ( selected_partition .type == GParted::LOGICAL ) { @@ -927,7 +927,7 @@ void Win_GParted::activate_paste() { if ( ! max_amount_prim_reached( ) ) { - Dialog_Partition_Copy dialog( gparted_core .get_fs( ), devices[ current_device ] .heads * devices[ current_device ] .sectors ) ; + Dialog_Partition_Copy dialog( Get_FS( copied_partition .filesystem, gparted_core .get_fs( ) ), devices[ current_device ] .heads * devices[ current_device ] .sectors ) ; copied_partition .error .clear( ) ; //we don't need the errors of the source partition. dialog .Set_Data( selected_partition, copied_partition ) ; dialog .set_transient_for( *this );