diff --git a/ChangeLog b/ChangeLog index 834b053c..30f196a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-03-28 Bart Hakvoort + + * trivial cleanups + 2006-03-27 Bart Hakvoort * include/TreeView_Detail.h, diff --git a/include/Utils.h b/include/Utils.h index 08937990..b8b6c63e 100644 --- a/include/Utils.h +++ b/include/Utils.h @@ -111,16 +111,17 @@ struct FS class Utils { public: - static Sector Round( double double_value ) ; + static Sector round( double double_value ) ; static Gtk::Label * mk_label( const Glib::ustring & text, bool use_markup = true, - Gtk::AlignmentEnum alignment = Gtk::ALIGN_LEFT, + Gtk::AlignmentEnum x_align = Gtk::ALIGN_LEFT, + Gtk::AlignmentEnum y_align = Gtk::ALIGN_CENTER, bool wrap = false, const Glib::ustring & text_color = "black" ) ; static Glib::ustring num_to_str( Sector number, bool use_C_locale = false ) ; - static Glib::ustring Get_Color( FILESYSTEM filesystem ) ; + static Glib::ustring get_color( FILESYSTEM filesystem ) ; static Glib::RefPtr get_color_as_pixbuf( FILESYSTEM filesystem, int width, int height ) ; - static Glib::ustring Get_Filesystem_String( FILESYSTEM filesystem ) ; + static Glib::ustring get_filesystem_string( FILESYSTEM filesystem ) ; static Glib::ustring format_size( Sector size ) ; static double sector_to_unit( Sector sectors, SIZE_UNIT size_unit ) ; static int execute_command( const Glib::ustring & command, diff --git a/src/Dialog_Base_Partition.cc b/src/Dialog_Base_Partition.cc index 4b96cfea..0e2a24f5 100644 --- a/src/Dialog_Base_Partition.cc +++ b/src/Dialog_Base_Partition.cc @@ -265,9 +265,9 @@ void Dialog_Base_Partition::on_spinbutton_value_changed( SPINBUTTON spinbutton ) //And apply the changes to the visual view... if ( ! fixed_start ) - frame_resizer_base ->set_x_start( Utils::Round( spinbutton_before .get_value() / MB_PER_PIXEL ) ) ; + frame_resizer_base ->set_x_start( Utils::round( spinbutton_before .get_value() / MB_PER_PIXEL ) ) ; - frame_resizer_base ->set_x_end( 500 - Utils::Round( spinbutton_after .get_value() / MB_PER_PIXEL ) ) ; + frame_resizer_base ->set_x_end( 500 - Utils::round( spinbutton_after .get_value() / MB_PER_PIXEL ) ) ; frame_resizer_base ->Draw_Partition() ; diff --git a/src/Dialog_Disklabel.cc b/src/Dialog_Disklabel.cc index 3ed62227..094e3279 100644 --- a/src/Dialog_Disklabel.cc +++ b/src/Dialog_Disklabel.cc @@ -20,23 +20,23 @@ namespace GParted { -Dialog_Disklabel::Dialog_Disklabel( const Glib::ustring & device_path, const std::vector & disklabeltypes ) +Dialog_Disklabel::Dialog_Disklabel( const Glib::ustring & device_path, const std::vector & disklabeltypes ) { this ->set_title( String::ucompose( _("Set Disklabel on %1"), device_path ) ); this ->set_has_separator( false ) ; this ->set_resizable( false ); - hbox = manage( new Gtk::HBox( ) ) ; - this ->get_vbox( ) ->pack_start( *hbox, Gtk::PACK_SHRINK ); + hbox = manage( new Gtk::HBox() ) ; + this ->get_vbox() ->pack_start( *hbox, Gtk::PACK_SHRINK ); - vbox = manage( new Gtk::VBox( ) ) ; + vbox = manage( new Gtk::VBox() ) ; vbox ->set_border_width( 10 ) ; hbox ->pack_start( *vbox, Gtk::PACK_SHRINK ); image .set( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG ) ; vbox ->pack_start( image, Gtk::PACK_SHRINK ); - vbox = manage( new Gtk::VBox( ) ) ; + vbox = manage( new Gtk::VBox() ) ; vbox ->set_border_width( 10 ) ; hbox ->pack_start( *vbox, Gtk::PACK_SHRINK ); @@ -51,7 +51,8 @@ Dialog_Disklabel::Dialog_Disklabel( const Glib::ustring & device_path, const std str_temp += "\n\n" ; str_temp += _("By default GParted creates an msdos disklabel.") ; str_temp += "\n" ; - vbox ->pack_start( * Utils::mk_label( str_temp, true, Gtk::ALIGN_LEFT, true ), Gtk::PACK_SHRINK ); + vbox ->pack_start( * Utils::mk_label( str_temp, true, Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, true ), + Gtk::PACK_SHRINK ); //advanced str_temp = "" ; @@ -63,7 +64,7 @@ Dialog_Disklabel::Dialog_Disklabel( const Glib::ustring & device_path, const std hbox = manage( new Gtk::HBox( false, 5 ) ) ; hbox ->set_border_width( 5 ) ; - str_temp = _("Select new labeltype:") ;//FIXME: this label shouldn't be topaligned.. + str_temp = _("Select new labeltype:") ; str_temp += "\t" ; hbox ->pack_start( * Utils::mk_label( str_temp ), Gtk::PACK_SHRINK ); expander_advanced .add( *hbox ) ; @@ -71,7 +72,7 @@ Dialog_Disklabel::Dialog_Disklabel( const Glib::ustring & device_path, const std //create and add combo with labeltypes this ->labeltypes = disklabeltypes ; - for ( unsigned int t = 0 ; t < labeltypes .size( ) ; t++ ) + for ( unsigned int t = 0 ; t < labeltypes .size() ; t++ ) combo_labeltypes .append_text( labeltypes[ t ] ) ; combo_labeltypes .set_active( 0 ) ; @@ -82,15 +83,15 @@ Dialog_Disklabel::Dialog_Disklabel( const Glib::ustring & device_path, const std str_temp += String::ucompose( _("WARNING: Creating a new disklabel will erase all data on %1!"), device_path ) ; str_temp += "\n"; - this ->get_vbox( ) ->pack_start( * Utils::mk_label( str_temp ), Gtk::PACK_SHRINK ); + this ->get_vbox() ->pack_start( * Utils::mk_label( str_temp ), Gtk::PACK_SHRINK ); this ->add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL ); this ->add_button( _("Create"), Gtk::RESPONSE_OK ); - this ->show_all_children( ) ; + this ->show_all_children() ; } -Glib::ustring Dialog_Disklabel::Get_Disklabel( ) +Glib::ustring Dialog_Disklabel::Get_Disklabel() { return labeltypes[ combo_labeltypes .get_active_row_number() ] ; } diff --git a/src/Dialog_Filesystems.cc b/src/Dialog_Filesystems.cc index 106cdd64..ce5a3c18 100644 --- a/src/Dialog_Filesystems.cc +++ b/src/Dialog_Filesystems.cc @@ -56,7 +56,7 @@ void Dialog_Filesystems::Load_Filesystems( const std::vector< FS > & FILESYSTEMS void Dialog_Filesystems::Show_Filesystem( const FS & fs ) { treerow = *( liststore_filesystems ->append() ); - treerow[ treeview_filesystems_columns .filesystem ] = Utils::Get_Filesystem_String( fs .filesystem ) ; + treerow[ treeview_filesystems_columns .filesystem ] = Utils::get_filesystem_string( fs .filesystem ) ; treerow[ treeview_filesystems_columns .create ] = render_icon( fs .create ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR); diff --git a/src/Dialog_Partition_Copy.cc b/src/Dialog_Partition_Copy.cc index ce802d9b..2fdab5d0 100644 --- a/src/Dialog_Partition_Copy.cc +++ b/src/Dialog_Partition_Copy.cc @@ -40,17 +40,17 @@ void Dialog_Partition_Copy::Set_Data( const Partition & selected_partition, cons //set some widely used values... START = selected_partition .sector_start ; total_length = selected_partition .get_length() ; - TOTAL_MB = Utils::Round( Utils::sector_to_unit( selected_partition .get_length(), GParted::UNIT_MIB ) ) ; + TOTAL_MB = Utils::round( Utils::sector_to_unit( selected_partition .get_length(), GParted::UNIT_MIB ) ) ; MB_PER_PIXEL = TOTAL_MB / 500.00 ; - long COPIED_LENGTH_MB = Utils::Round( Utils::sector_to_unit( copied_partition .get_length(), GParted::UNIT_MIB ) ) ; + long COPIED_LENGTH_MB = Utils::round( Utils::sector_to_unit( copied_partition .get_length(), GParted::UNIT_MIB ) ) ; //now calculate proportional length of partition frame_resizer_base ->set_x_start( 0 ) ; - int x_end = Utils::Round( COPIED_LENGTH_MB / ( TOTAL_MB/500.00 ) ) ; //> 500 px only possible with xfs... + int x_end = Utils::round( COPIED_LENGTH_MB / ( TOTAL_MB/500.00 ) ) ; //> 500 px only possible with xfs... frame_resizer_base ->set_x_end( x_end > 500 ? 500 : x_end ) ; frame_resizer_base ->set_used( - Utils::Round( Utils::sector_to_unit( + Utils::round( Utils::sector_to_unit( copied_partition .sectors_used, GParted::UNIT_MIB ) / (TOTAL_MB/500.00) ) ) ; fs .MAX = ( ! fs .MAX || fs .MAX > (TOTAL_MB * MEBIBYTE) ) ? (TOTAL_MB * MEBIBYTE) : fs .MAX -= BUF ; @@ -62,27 +62,27 @@ void Dialog_Partition_Copy::Set_Data( const Partition & selected_partition, cons GRIP = true ; //set values of spinbutton_before - spinbutton_before .set_range( 0, TOTAL_MB - Utils::Round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ) ) ; + spinbutton_before .set_range( 0, TOTAL_MB - Utils::round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ) ) ; spinbutton_before .set_value( 0 ) ; //set values of spinbutton_size spinbutton_size .set_range( - Utils::Round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ), - Utils::Round( Utils::sector_to_unit( fs .MAX, GParted::UNIT_MIB ) ) ) ; + Utils::round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ), + Utils::round( Utils::sector_to_unit( fs .MAX, GParted::UNIT_MIB ) ) ) ; spinbutton_size .set_value( COPIED_LENGTH_MB ) ; //set values of spinbutton_after - spinbutton_after .set_range( 0, TOTAL_MB - Utils::Round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ) ) ; + spinbutton_after .set_range( 0, TOTAL_MB - Utils::round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ) ) ; spinbutton_after .set_value( TOTAL_MB - COPIED_LENGTH_MB ) ; GRIP = false ; - frame_resizer_base ->set_size_limits( Utils::Round( fs .MIN / (MB_PER_PIXEL * MEBIBYTE) ), - Utils::Round( fs .MAX / (MB_PER_PIXEL * MEBIBYTE) ) ) ; + frame_resizer_base ->set_size_limits( Utils::round( fs .MIN / (MB_PER_PIXEL * MEBIBYTE) ), + Utils::round( fs .MAX / (MB_PER_PIXEL * MEBIBYTE) ) ) ; //set contents of label_minmax Set_MinMax_Text( - Utils::Round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ), - Utils::Round( Utils::sector_to_unit( fs .MAX, GParted::UNIT_MIB ) ) ) ; + Utils::round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ), + Utils::round( Utils::sector_to_unit( fs .MAX, GParted::UNIT_MIB ) ) ) ; //set global selected_partition (see Dialog_Base_Partition::Get_New_Partition ) this ->selected_partition = copied_partition ; diff --git a/src/Dialog_Partition_Info.cc b/src/Dialog_Partition_Info.cc index 56d658aa..1bb31698 100644 --- a/src/Dialog_Partition_Info.cc +++ b/src/Dialog_Partition_Info.cc @@ -49,7 +49,8 @@ Dialog_Partition_Info::Dialog_Partition_Info( const Partition & partition ) Gtk::PACK_SHRINK ) ; frame ->set_label_widget( *hbox ) ; - frame ->add( * Utils::mk_label( "" + partition.error + "", true, Gtk::ALIGN_LEFT, true ) ) ; + frame ->add( * Utils::mk_label( + "" + partition .error + "", true, Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, true ) ) ; this ->get_vbox() ->pack_start( *frame, Gtk::PACK_SHRINK ) ; } @@ -103,7 +104,7 @@ void Dialog_Partition_Info::init_drawingarea() //calculate proportional width of used and unused used = unused = 0 ; - used = Utils::Round( + used = Utils::round( (400 - BORDER *2) / ( static_cast( partition .get_length() ) / partition .sectors_used ) ) ; unused = 400 - used - BORDER *2 ; @@ -140,7 +141,7 @@ void Dialog_Partition_Info::Display_Info() 0, 1, top, bottom, Gtk::FILL ) ; - table ->attach( * Utils::mk_label( Utils::Get_Filesystem_String( partition .filesystem ) ), + table ->attach( * Utils::mk_label( Utils::get_filesystem_string( partition .filesystem ) ), 1, 2, top++, bottom++, Gtk::FILL ) ; @@ -159,7 +160,7 @@ void Dialog_Partition_Info::Display_Info() { //calculate relative diskusage int percent_used = - Utils::Round( partition .sectors_used / static_cast( partition .get_length() ) * 100 ) ; + Utils::round( partition .sectors_used / static_cast( partition .get_length() ) * 100 ) ; //used table ->attach( * Utils::mk_label( "" + static_cast( _("Used:") ) + "" ), @@ -209,7 +210,10 @@ void Dialog_Partition_Info::Display_Info() if ( partition .type != GParted::TYPE_UNALLOCATED && partition .status != GParted::STAT_NEW ) { //path - table ->attach( * Utils::mk_label( "" + static_cast( _("Path:") ) + "" ), + table ->attach( * Utils::mk_label( "" + static_cast( _("Path:") ) + "", + true, + Gtk::ALIGN_LEFT, + Gtk::ALIGN_TOP ), 0, 1, top, bottom, Gtk::FILL ) ; diff --git a/src/Dialog_Partition_New.cc b/src/Dialog_Partition_New.cc index 56d53aa0..e3c02906 100644 --- a/src/Dialog_Partition_New.cc +++ b/src/Dialog_Partition_New.cc @@ -111,7 +111,7 @@ void Dialog_Partition_New::Set_Data( const Partition & partition, //set some widely used values... START = partition.sector_start ; total_length = partition.sector_end - partition.sector_start ; - TOTAL_MB = Utils::Round( Utils::sector_to_unit( this ->selected_partition .get_length(), GParted::UNIT_MIB ) ) ; + TOTAL_MB = Utils::round( Utils::sector_to_unit( this ->selected_partition .get_length(), GParted::UNIT_MIB ) ) ; MB_PER_PIXEL = TOTAL_MB / 500.00 ; //set first enabled filesystem @@ -120,7 +120,7 @@ void Dialog_Partition_New::Set_Data( const Partition & partition, //set spinbuttons initial values spinbutton_after .set_value( 0 ) ; - spinbutton_size .set_value( Utils::Round( Utils::sector_to_unit( fs .MAX, GParted::UNIT_MIB ) ) ) ; + spinbutton_size .set_value( Utils::round( Utils::sector_to_unit( fs .MAX, GParted::UNIT_MIB ) ) ) ; spinbutton_before .set_value( 0 ) ; //euhrm, this wil only happen when there's a very small free space (usually the effect of a bad partitionmanager) @@ -194,7 +194,7 @@ void Dialog_Partition_New::optionmenu_changed( bool type ) menu_filesystem .items() .size() < FILESYSTEMS .size() ) { menu_filesystem .items() .push_back( - Gtk::Menu_Helpers::MenuElem( Utils::Get_Filesystem_String( GParted::FS_EXTENDED ) ) ) ; + Gtk::Menu_Helpers::MenuElem( Utils::get_filesystem_string( GParted::FS_EXTENDED ) ) ) ; optionmenu_filesystem .set_history( menu_filesystem .items() .size() -1 ) ; optionmenu_filesystem .set_sensitive( false ) ; } @@ -226,22 +226,22 @@ void Dialog_Partition_New::optionmenu_changed( bool type ) fs .MAX = ( fs .MAX && ( fs .MAX - cylinder_size ) < (TOTAL_MB * MEBIBYTE) ) ? fs .MAX - cylinder_size : TOTAL_MB * MEBIBYTE ; - frame_resizer_base ->set_size_limits( Utils::Round( fs .MIN / (MB_PER_PIXEL * MEBIBYTE) ), - Utils::Round( fs .MAX / (MB_PER_PIXEL * MEBIBYTE) ) ) ; + frame_resizer_base ->set_size_limits( Utils::round( fs .MIN / (MB_PER_PIXEL * MEBIBYTE) ), + Utils::round( fs .MAX / (MB_PER_PIXEL * MEBIBYTE) ) ) ; //set new spinbutton ranges spinbutton_before .set_range( - 0, TOTAL_MB - Utils::Round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ) ) ; + 0, TOTAL_MB - Utils::round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ) ) ; spinbutton_size .set_range( - Utils::Round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ), - Utils::Round( Utils::sector_to_unit( fs .MAX, GParted::UNIT_MIB ) ) ) ; + Utils::round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ), + Utils::round( Utils::sector_to_unit( fs .MAX, GParted::UNIT_MIB ) ) ) ; spinbutton_after .set_range( - 0, TOTAL_MB - Utils::Round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ) ) ; + 0, TOTAL_MB - Utils::round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ) ) ; //set contents of label_minmax Set_MinMax_Text( - Utils::Round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ), - Utils::Round( Utils::sector_to_unit( fs .MAX, GParted::UNIT_MIB ) ) ) ; + Utils::round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ), + Utils::round( Utils::sector_to_unit( fs .MAX, GParted::UNIT_MIB ) ) ) ; } //set fitting resizer colors @@ -250,7 +250,7 @@ void Dialog_Partition_New::optionmenu_changed( bool type ) frame_resizer_base ->override_default_rgb_unused_color( color_temp ); //partitioncolor.. - color_temp .set( Utils::Get_Color( fs .filesystem ) ) ; + color_temp .set( Utils::get_color( fs .filesystem ) ) ; frame_resizer_base ->set_rgb_partition_color( color_temp ) ; frame_resizer_base ->Draw_Partition() ; @@ -262,7 +262,7 @@ void Dialog_Partition_New::Build_Filesystems_Menu( bool only_unformatted ) for ( unsigned int t = 0 ; t < FILESYSTEMS .size( ) -1 ; t++ ) { menu_filesystem .items() .push_back( - Gtk::Menu_Helpers::MenuElem( Utils::Get_Filesystem_String( FILESYSTEMS[ t ] .filesystem ) ) ) ; + Gtk::Menu_Helpers::MenuElem( Utils::get_filesystem_string( FILESYSTEMS[ t ] .filesystem ) ) ) ; menu_filesystem .items()[ t ] .set_sensitive( ! only_unformatted && FILESYSTEMS[ t ] .create && this ->selected_partition .get_length() >= FILESYSTEMS[ t ] .MIN ) ; diff --git a/src/Dialog_Partition_Resize_Move.cc b/src/Dialog_Partition_Resize_Move.cc index 003c3e48..27c36b0a 100644 --- a/src/Dialog_Partition_Resize_Move.cc +++ b/src/Dialog_Partition_Resize_Move.cc @@ -100,15 +100,15 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vectorset_x_start( Utils::Round( previous / ( total_length / 500.00 ) ) ) ; + frame_resizer_base ->set_x_start( Utils::round( previous / ( total_length / 500.00 ) ) ) ; frame_resizer_base ->set_x_end( - Utils::Round( selected_partition .get_length() / ( total_length / 500.00 ) ) + frame_resizer_base ->get_x_start() ) ; - frame_resizer_base ->set_used( Utils::Round( selected_partition.sectors_used / ( total_length / 500.00 ) ) ) ; + Utils::round( selected_partition .get_length() / ( total_length / 500.00 ) ) + frame_resizer_base ->get_x_start() ) ; + frame_resizer_base ->set_used( Utils::round( selected_partition.sectors_used / ( total_length / 500.00 ) ) ) ; if ( fs .shrink ) { @@ -131,28 +131,28 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vectorset_size_limits( Utils::Round( fs .MIN / (MB_PER_PIXEL * MEBIBYTE) ), - Utils::Round( fs .MAX / (MB_PER_PIXEL * MEBIBYTE) ) ) ; + frame_resizer_base ->set_size_limits( Utils::round( fs .MIN / (MB_PER_PIXEL * MEBIBYTE) ), + Utils::round( fs .MAX / (MB_PER_PIXEL * MEBIBYTE) ) ) ; //set contents of label_minmax Set_MinMax_Text( - Utils::Round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ), - Utils::Round( Utils::sector_to_unit( fs .MAX, GParted::UNIT_MIB ) ) ) ; + Utils::round( Utils::sector_to_unit( fs .MIN, GParted::UNIT_MIB ) ), + Utils::round( Utils::sector_to_unit( fs .MAX, GParted::UNIT_MIB ) ) ) ; } void Dialog_Partition_Resize_Move::Resize_Move_Extended( const std::vector & partitions ) @@ -179,12 +179,12 @@ void Dialog_Partition_Resize_Move::Resize_Move_Extended( const std::vectorset_x_start( Utils::Round( previous / ( total_length / 500.00 ) ) ) ; - frame_resizer_base ->set_x_end( Utils::Round( selected_partition .get_length() / ( total_length / 500.00 ) ) + frame_resizer_base ->get_x_start() ) ; + frame_resizer_base ->set_x_start( Utils::round( previous / ( total_length / 500.00 ) ) ) ; + frame_resizer_base ->set_x_end( Utils::round( selected_partition .get_length() / ( total_length / 500.00 ) ) + frame_resizer_base ->get_x_start() ) ; //used is a bit different here... we consider start of first logical to end last logical as used space Sector first =0, used =0 ; @@ -200,39 +200,39 @@ void Dialog_Partition_Resize_Move::Resize_Move_Extended( const std::vector( frame_resizer_base ) -> - set_used_start( Utils::Round( (first - START) / ( total_length / 500.00 ) ) ) ; - frame_resizer_base ->set_used( Utils::Round( used / ( total_length / 500.00 ) ) ) ; + set_used_start( Utils::round( (first - START) / ( total_length / 500.00 ) ) ) ; + frame_resizer_base ->set_used( Utils::round( used / ( total_length / 500.00 ) ) ) ; //set values of spinbutton_before (we assume there is no fixed start.) if ( first == 0 ) //no logicals - spinbutton_before .set_range( 0, TOTAL_MB - Utils::Round( Utils::sector_to_unit( BUF/2, GParted::UNIT_MIB ) ) ) ; + spinbutton_before .set_range( 0, TOTAL_MB - Utils::round( Utils::sector_to_unit( BUF/2, GParted::UNIT_MIB ) ) ) ; else - spinbutton_before .set_range( 0, Utils::Round( Utils::sector_to_unit( first - START, GParted::UNIT_MIB ) ) ) ; + spinbutton_before .set_range( 0, Utils::round( Utils::sector_to_unit( first - START, GParted::UNIT_MIB ) ) ) ; - spinbutton_before .set_value( Utils::Round( Utils::sector_to_unit( previous, GParted::UNIT_MIB ) ) ) ; + spinbutton_before .set_value( Utils::round( Utils::sector_to_unit( previous, GParted::UNIT_MIB ) ) ) ; //set values of spinbutton_size if ( first == 0 ) //no logicals - spinbutton_size .set_range( Utils::Round( Utils::sector_to_unit( BUF/2, GParted::UNIT_MIB ) ), TOTAL_MB ) ; + spinbutton_size .set_range( Utils::round( Utils::sector_to_unit( BUF/2, GParted::UNIT_MIB ) ), TOTAL_MB ) ; else - spinbutton_size .set_range( Utils::Round( Utils::sector_to_unit( used, GParted::UNIT_MIB ) ), TOTAL_MB ) ; + spinbutton_size .set_range( Utils::round( Utils::sector_to_unit( used, GParted::UNIT_MIB ) ), TOTAL_MB ) ; spinbutton_size .set_value( - Utils::Round( Utils::sector_to_unit( selected_partition .get_length(), GParted::UNIT_MIB ) ) ) ; + Utils::round( Utils::sector_to_unit( selected_partition .get_length(), GParted::UNIT_MIB ) ) ) ; //set values of spinbutton_after if ( first == 0 ) //no logicals spinbutton_after .set_range( - 0, TOTAL_MB - Utils::Round( Utils::sector_to_unit( BUF/2, GParted::UNIT_MIB ) ) ) ; + 0, TOTAL_MB - Utils::round( Utils::sector_to_unit( BUF/2, GParted::UNIT_MIB ) ) ) ; else spinbutton_after .set_range( - 0, Utils::Round( Utils::sector_to_unit( total_length + START - first - used, GParted::UNIT_MIB ) ) ) ; + 0, Utils::round( Utils::sector_to_unit( total_length + START - first - used, GParted::UNIT_MIB ) ) ) ; - spinbutton_after .set_value( Utils::Round( Utils::sector_to_unit( next, GParted::UNIT_MIB ) ) ) ; + spinbutton_after .set_value( Utils::round( Utils::sector_to_unit( next, GParted::UNIT_MIB ) ) ) ; //set contents of label_minmax - Set_MinMax_Text( Utils::Round( Utils::sector_to_unit( first == 0 ? BUF/2 : used, GParted::UNIT_MIB ) ), - Utils::Round( Utils::sector_to_unit( total_length, GParted::UNIT_MIB ) ) ) ; + Set_MinMax_Text( Utils::round( Utils::sector_to_unit( first == 0 ? BUF/2 : used, GParted::UNIT_MIB ) ), + Utils::round( Utils::sector_to_unit( total_length, GParted::UNIT_MIB ) ) ) ; } } //GParted diff --git a/src/DrawingAreaVisualDisk.cc b/src/DrawingAreaVisualDisk.cc index 9a032360..24a6b076 100644 --- a/src/DrawingAreaVisualDisk.cc +++ b/src/DrawingAreaVisualDisk.cc @@ -30,10 +30,10 @@ DrawingAreaVisualDisk::DrawingAreaVisualDisk() selected_vp = NULL ; //set and allocated some standard colors - color_used .set( Utils::Get_Color( GParted::FS_USED ) ); + color_used .set( Utils::get_color( GParted::FS_USED ) ); get_colormap() ->alloc_color( color_used ) ; - color_unused .set( Utils::Get_Color( GParted::FS_UNUSED ) ); + color_unused .set( Utils::get_color( GParted::FS_UNUSED ) ); get_colormap() ->alloc_color( color_unused ) ; color_text .set( "black" ); @@ -117,7 +117,7 @@ int DrawingAreaVisualDisk::calc_length( std::vector & visual_p for ( int t = 0 ; t < static_cast( visual_partitions .size() ) ; t++ ) { - visual_partitions[ t ] .length = Utils::Round( length_px * visual_partitions[ t ] .fraction ) ; + visual_partitions[ t ] .length = Utils::round( length_px * visual_partitions[ t ] .fraction ) ; if ( visual_partitions[ t ] .logicals .size() > 0 ) visual_partitions[ t ] .length = @@ -162,7 +162,7 @@ void DrawingAreaVisualDisk::calc_used_unused( std::vector & vi if ( visual_partitions[ t ] .fraction_used ) visual_partitions[ t ] .used_length = - Utils::Round( ( visual_partitions[ t ] .length - (2*BORDER) ) * visual_partitions[ t ] .fraction_used ) ; + Utils::round( ( visual_partitions[ t ] .length - (2*BORDER) ) * visual_partitions[ t ] .fraction_used ) ; //unused visual_partitions[ t ] .x_unused_start = @@ -193,10 +193,10 @@ void DrawingAreaVisualDisk::calc_text( std::vector & visual_pa if ( length < visual_partitions[ t ] .length - (2 * BORDER) - 2 ) { visual_partitions[ t ] .x_text = visual_partitions[ t ] .x_start + - Utils::Round( (visual_partitions[ t ] .length / 2) - (length / 2) ) ; + Utils::round( (visual_partitions[ t ] .length / 2) - (length / 2) ) ; visual_partitions[ t ] .y_text = visual_partitions[ t ] .y_start + - Utils::Round( (visual_partitions[ t ] .height / 2) - (height / 2) ) ; + Utils::round( (visual_partitions[ t ] .height / 2) - (height / 2) ) ; } else visual_partitions[ t ] .x_text = visual_partitions[ t ] .y_text = 0 ; diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index b80c28d7..ac15e20c 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -272,6 +272,8 @@ void GParted_Core::init_maps() } proc_partitions .close() ; + alternate_paths[ "/dev/hda5" ] = "/dev/bladieblaaaaa" ; + alternate_paths[ "/dev/hda" ] = "/dev/nog_een_testje" ; } } @@ -1125,7 +1127,7 @@ bool GParted_Core::set_partition_type( const Partition & partition, if ( open_device_and_disk( partition .device_path ) ) { PedFileSystemType * fs_type = - ped_file_system_type_get( Utils::Get_Filesystem_String( partition .filesystem ) .c_str() ) ; + ped_file_system_type_get( Utils::get_filesystem_string( partition .filesystem ) .c_str() ) ; //default is Linux (83) if ( ! fs_type ) diff --git a/src/OperationCreate.cc b/src/OperationCreate.cc index 0d348aaf..f7b97743 100644 --- a/src/OperationCreate.cc +++ b/src/OperationCreate.cc @@ -88,7 +88,7 @@ void OperationCreate::create_description() description = String::ucompose( _("Create %1 #%2 (%3, %4) on %5"), description, partition_new .partition_number, - Utils::Get_Filesystem_String( partition_new .filesystem ), + Utils::get_filesystem_string( partition_new .filesystem ), Utils::format_size( partition_new .get_length() ), device .get_path() ) ; } diff --git a/src/OperationDelete.cc b/src/OperationDelete.cc index c1b59870..6455732f 100644 --- a/src/OperationDelete.cc +++ b/src/OperationDelete.cc @@ -81,7 +81,7 @@ void OperationDelete::create_description() /*TO TRANSLATORS: looks like Delete /dev/hda2 (ntfs, 345 MiB) from /dev/hda */ description = String::ucompose( _("Delete %1 (%2, %3) from %4"), description, - Utils::Get_Filesystem_String( partition_original .filesystem ), + Utils::get_filesystem_string( partition_original .filesystem ), Utils::format_size( partition_original .get_length() ), partition_original .device_path ) ; } diff --git a/src/OperationFormat.cc b/src/OperationFormat.cc index bffde475..273ee06b 100644 --- a/src/OperationFormat.cc +++ b/src/OperationFormat.cc @@ -59,7 +59,7 @@ void OperationFormat::create_description() /*TO TRANSLATORS: looks like Format /dev/hda4 as linux-swap */ description = String::ucompose( _("Format %1 as %2"), partition_original .get_path(), - Utils::Get_Filesystem_String( partition_new .filesystem ) ) ; + Utils::get_filesystem_string( partition_new .filesystem ) ) ; } } //GParted diff --git a/src/Partition.cc b/src/Partition.cc index b0dbbde8..0bfa2f06 100644 --- a/src/Partition.cc +++ b/src/Partition.cc @@ -69,7 +69,7 @@ void Partition::Set( const Glib::ustring & device_path, this ->inside_extended = inside_extended; this ->busy = busy; - this ->color .set( Utils::Get_Color( filesystem ) ); + this ->color .set( Utils::get_color( filesystem ) ); } void Partition::Set_Unused( Sector sectors_unused ) @@ -89,7 +89,7 @@ void Partition::Set_Unallocated( const Glib::ustring & device_path, Reset() ; Set( device_path, - Utils::Get_Filesystem_String( GParted::FS_UNALLOCATED ), + Utils::get_filesystem_string( GParted::FS_UNALLOCATED ), -1, GParted::TYPE_UNALLOCATED, GParted::FS_UNALLOCATED, diff --git a/src/TreeView_Detail.cc b/src/TreeView_Detail.cc index bfa54353..80e7a454 100644 --- a/src/TreeView_Detail.cc +++ b/src/TreeView_Detail.cc @@ -175,7 +175,7 @@ void TreeView_Detail::create_row( const Gtk::TreeRow & treerow, const Partition partition .type == GParted::TYPE_UNALLOCATED ? "darkgrey" : "black" ; treerow[ treeview_detail_columns .filesystem ] = - Utils::Get_Filesystem_String( partition .filesystem ) ; + Utils::get_filesystem_string( partition .filesystem ) ; //mountpoint treerow[ treeview_detail_columns .mount_text_color ] = partition .busy ? "black" : "darkgrey" ; diff --git a/src/Utils.cc b/src/Utils.cc index 150030b9..d1dde6db 100644 --- a/src/Utils.cc +++ b/src/Utils.cc @@ -23,18 +23,20 @@ namespace GParted { -Sector Utils::Round( double double_value ) +Sector Utils::round( double double_value ) { return static_cast( double_value + 0.5 ) ; } Gtk::Label * Utils::mk_label( const Glib::ustring & text, bool use_markup, - Gtk::AlignmentEnum alignment, + Gtk::AlignmentEnum x_align, + Gtk::AlignmentEnum y_align, bool wrap, const Glib::ustring & text_color ) { - Gtk::Label * label = manage( new Gtk::Label( text, alignment, Gtk::ALIGN_TOP ) ) ; + + Gtk::Label * label = manage( new Gtk::Label( text, x_align, y_align ) ) ; label ->set_use_markup( use_markup ) ; label ->set_line_wrap( wrap ) ; @@ -57,7 +59,7 @@ Glib::ustring Utils::num_to_str( Sector number, bool use_C_locale ) } //use http://developer.gnome.org/projects/gup/hig/2.0/design.html#Palette as a starting point.. -Glib::ustring Utils::Get_Color( FILESYSTEM filesystem ) +Glib::ustring Utils::get_color( FILESYSTEM filesystem ) { switch( filesystem ) { @@ -91,7 +93,7 @@ Glib::RefPtr Utils::get_color_as_pixbuf( FILESYSTEM filesystem, int if ( pixbuf ) { - std::stringstream hex( Get_Color( filesystem ) .substr( 1 ) + "00" ) ; + std::stringstream hex( get_color( filesystem ) .substr( 1 ) + "00" ) ; unsigned long dec ; hex >> std::hex >> dec ; @@ -101,7 +103,7 @@ Glib::RefPtr Utils::get_color_as_pixbuf( FILESYSTEM filesystem, int return pixbuf ; } -Glib::ustring Utils::Get_Filesystem_String( FILESYSTEM filesystem ) +Glib::ustring Utils::get_filesystem_string( FILESYSTEM filesystem ) { switch( filesystem ) { diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index ceda72b9..52acd993 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -288,7 +288,7 @@ Gtk::Menu * Win_GParted::create_format_menu() //the label... hbox ->pack_start( * Utils::mk_label( " " + - Utils::Get_Filesystem_String( gparted_core .get_filesystems()[ t ] .filesystem ) ), + Utils::get_filesystem_string( gparted_core .get_filesystems()[ t ] .filesystem ) ), Gtk::PACK_SHRINK ); menu ->items() .push_back( * manage( new Gtk::MenuItem( *hbox ) ) ); @@ -306,64 +306,93 @@ Gtk::Menu * Win_GParted::create_format_menu() void Win_GParted::init_device_info() { vbox_info.set_spacing( 5 ); - int top =0, bottom = 1; + int top = 0, bottom = 1; //title - vbox_info .pack_start( * Utils::mk_label( " " + (Glib::ustring) _( "Harddisk Information" ) + ":" ), Gtk::PACK_SHRINK ); + vbox_info .pack_start( + * Utils::mk_label( " " + static_cast( _("Harddisk Information") ) + ":" ), + Gtk::PACK_SHRINK ); //GENERAL DEVICE INFO table = manage( new Gtk::Table() ) ; table ->set_col_spacings( 10 ) ; //model - table ->attach( * Utils::mk_label( " " + (Glib::ustring) _( "Model:" ) + "" ) , 0,1,top, bottom ,Gtk::FILL); + table ->attach( * Utils::mk_label( " " + static_cast( _("Model:") ) + "" ), + 0, 1, + top, bottom, + Gtk::FILL ) ; device_info .push_back( Utils::mk_label( "" ) ) ; - table ->attach( * device_info .back(), 1,2, top++, bottom++, Gtk::FILL); + table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ; //size - table ->attach( * Utils::mk_label( " " + (Glib::ustring) _( "Size:" ) + "" ) , 0,1,top, bottom ,Gtk::FILL); + table ->attach( * Utils::mk_label( " " + static_cast( _("Size:") ) + "" ), + 0, 1, + top, bottom, + Gtk::FILL ) ; device_info .push_back( Utils::mk_label( "" ) ) ; - table ->attach( * device_info .back(), 1,2, top++, bottom++, Gtk::FILL); + table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ; //path - table ->attach( * Utils::mk_label( " " + (Glib::ustring) _( "Path:" ) + "" ) , 0,1,top, bottom ,Gtk::FILL); + table ->attach( * Utils::mk_label( " " + static_cast( _("Path:") ) + "", + true, + Gtk::ALIGN_LEFT, + Gtk::ALIGN_TOP ), + 0, 1, + top, bottom, + Gtk::FILL ) ; device_info .push_back( Utils::mk_label( "" ) ) ; - table ->attach( * device_info .back(), 1,2, top++, bottom++, Gtk::FILL); + table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ; vbox_info .pack_start( *table, Gtk::PACK_SHRINK ); //DETAILED DEVICE INFO - top = 0; bottom = 1; - table = manage( new Gtk::Table( ) ) ; + top = 0 ; bottom = 1; + table = manage( new Gtk::Table() ) ; table ->set_col_spacings( 10 ) ; //one blank line table ->attach( * Utils::mk_label( "" ), 1, 2, top++, bottom++, Gtk::FILL ); //disktype - table ->attach( * Utils::mk_label( " " + (Glib::ustring) _( "DiskLabelType:" ) + "" ), 0, 1, top, bottom, Gtk::FILL ); + table ->attach( * Utils::mk_label( " " + static_cast( _("DiskLabelType:") ) + "" ), + 0, 1, + top, bottom, + Gtk::FILL ); device_info .push_back( Utils::mk_label( "" ) ) ; - table ->attach( * device_info .back( ), 1, 2, top++, bottom++, Gtk::FILL ); + table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ; //heads - table ->attach( * Utils::mk_label( " " + (Glib::ustring) _( "Heads:" ) + "" ), 0, 1, top, bottom, Gtk::FILL ); + table ->attach( * Utils::mk_label( " " + static_cast( _("Heads:") ) + "" ), + 0, 1, + top, bottom, + Gtk::FILL ) ; device_info .push_back( Utils::mk_label( "" ) ) ; - table ->attach( * device_info .back( ), 1, 2, top++, bottom++, Gtk::FILL ); + table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ; //sectors/track - table ->attach( * Utils::mk_label( " " + (Glib::ustring) _( "Sectors/Track:" ) + "" ) , 0, 1, top, bottom, Gtk::FILL ); + table ->attach( * Utils::mk_label( " " + static_cast( _("Sectors/Track:") ) + "" ), + 0, 1, + top, bottom, + Gtk::FILL ) ; device_info .push_back( Utils::mk_label( "" ) ) ; - table ->attach( * device_info .back( ), 1, 2, top++, bottom++, Gtk::FILL ); + table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ); //cylinders - table ->attach( * Utils::mk_label( " " + (Glib::ustring) _( "Cylinders:" ) + "" ), 0, 1, top, bottom, Gtk::FILL ); + table ->attach( * Utils::mk_label( " " + static_cast( _("Cylinders:") ) + "" ), + 0, 1, + top, bottom, + Gtk::FILL ) ; device_info .push_back( Utils::mk_label( "" ) ) ; - table ->attach( * device_info .back( ), 1, 2, top++, bottom++, Gtk::FILL ); + table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ; //total sectors - table ->attach( * Utils::mk_label( " " + (Glib::ustring) _( "Total Sectors:" ) + "" ), 0, 1, top, bottom, Gtk::FILL ); + table ->attach( * Utils::mk_label( " " + static_cast( _("Total Sectors:") ) + "" ), + 0, 1, + top, bottom, + Gtk::FILL ); device_info .push_back( Utils::mk_label( "" ) ) ; - table ->attach( * device_info .back( ), 1, 2, top++, bottom++, Gtk::FILL ); + table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ; vbox_info .pack_start( *table, Gtk::PACK_SHRINK ); } @@ -1297,7 +1326,7 @@ void Win_GParted::activate_delete() /*TO TRANSLATORS: dialogtitle, looks like Delete /dev/hda2 (ntfs, 2345 MiB) */ dialog .set_title( String::ucompose( _("Delete %1 (%2, %3)"), selected_partition .get_path(), - Utils::Get_Filesystem_String( selected_partition .filesystem ), + Utils::get_filesystem_string( selected_partition .filesystem ), Utils::format_size( selected_partition .get_length() ) ) ); dialog .add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL ); dialog .add_button( Gtk::Stock::DELETE, Gtk::RESPONSE_OK ); @@ -1357,7 +1386,7 @@ void Win_GParted::activate_format( GParted::FILESYSTEM new_fs ) { Gtk::MessageDialog dialog( *this, String::ucompose( _("Cannot format this filesystem to %1."), - Utils::Get_Filesystem_String( new_fs ) ) , + Utils::get_filesystem_string( new_fs ) ) , false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, @@ -1366,12 +1395,12 @@ void Win_GParted::activate_format( GParted::FILESYSTEM new_fs ) if ( selected_partition .get_length() < fs .MIN ) dialog .set_secondary_text( String::ucompose( _( "A %1 filesystem requires a partition of at least %2."), - Utils::Get_Filesystem_String( new_fs ), + Utils::get_filesystem_string( new_fs ), Utils::format_size( fs .MIN ) ) ); else dialog .set_secondary_text( String::ucompose( _( "A partition with a %1 filesystem has a maximum size of %2."), - Utils::Get_Filesystem_String( new_fs ), + Utils::get_filesystem_string( new_fs ), Utils::format_size( fs .MAX ) ) ); dialog .run() ; diff --git a/src/ext2.cc b/src/ext2.cc index 38478130..3a2529f6 100644 --- a/src/ext2.cc +++ b/src/ext2.cc @@ -64,7 +64,7 @@ void ext2::Set_Used_Sectors( Partition & partition ) S = -1 ; if ( N > -1 && S > -1 ) - partition .Set_Unused( Utils::Round( N * ( S / 512.0 ) ) ) ; + partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else partition .error = error ; @@ -74,7 +74,7 @@ bool ext2::Create( const Partition & new_partition, std::vector -1 && S > -1 ) - partition .Set_Unused( Utils::Round( N * ( S / 512.0 ) ) ) ; + partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else partition .error = error ; @@ -75,7 +75,7 @@ bool ext3::Create( const Partition & new_partition, std::vector -1 && S > -1 ) - partition .Set_Unused( Utils::Round( N * ( S / 512.0 ) ) ) ; + partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else partition .error = error ; @@ -78,7 +78,7 @@ bool fat16::Create( const Partition & new_partition, std::vector -1 && S > -1 ) - partition .Set_Unused( Utils::Round( N * ( S / 512.0 ) ) ) ; + partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else partition .error = error ; @@ -77,7 +77,7 @@ bool fat32::Create( const Partition & new_partition, std::vector { operation_details .push_back( OperationDetails( String::ucompose( _("create new %1 filesystem"), - Utils::Get_Filesystem_String( GParted::FS_HFS ) ) ) ) ; + Utils::get_filesystem_string( GParted::FS_HFS ) ) ) ) ; if ( ! execute_command( "hformat " + new_partition .get_path(), operation_details .back() .sub_details ) ) { diff --git a/src/jfs.cc b/src/jfs.cc index ca97c875..91ca4793 100644 --- a/src/jfs.cc +++ b/src/jfs.cc @@ -83,7 +83,7 @@ void jfs::Set_Used_Sectors( Partition & partition ) N = -1 ; if ( S > -1 && N > -1 ) - partition .Set_Unused( Utils::Round( N * ( S / 512.0 ) ) ) ; + partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else partition .error = error ; @@ -93,7 +93,7 @@ bool jfs::Create( const Partition & new_partition, std::vector { operation_details .push_back( OperationDetails( String::ucompose( _("create new %1 filesystem"), - Utils::Get_Filesystem_String( GParted::FS_JFS ) ) ) ) ; + Utils::get_filesystem_string( GParted::FS_JFS ) ) ) ) ; if ( ! execute_command( "mkfs.jfs -q " + new_partition .get_path(), operation_details .back() .sub_details ) ) { diff --git a/src/linux_swap.cc b/src/linux_swap.cc index 9f6bd20a..a1fcaef7 100644 --- a/src/linux_swap.cc +++ b/src/linux_swap.cc @@ -49,7 +49,7 @@ bool linux_swap::Create( const Partition & new_partition, std::vector -1 && S > -1 ) - partition .Set_Unused( Utils::Round( N * ( S / 512.0 ) ) ) ; + partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else partition .error = error ; @@ -68,7 +68,7 @@ bool reiser4::Create( const Partition & new_partition, std::vector -1 && S > -1 ) - partition .Set_Unused( Utils::Round( N * ( S / 512.0 ) ) ) ; + partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else partition .error = error ; @@ -78,7 +78,7 @@ bool reiserfs::Create( const Partition & new_partition, std::vector -1 && S > -1 ) - partition .Set_Unused( Utils::Round( N * ( S / 512.0 ) ) ) ; + partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else partition .error = error ; @@ -95,7 +95,7 @@ bool xfs::Create( const Partition & new_partition, std::vector { operation_details .push_back( OperationDetails( String::ucompose( _("create new %1 filesystem"), - Utils::Get_Filesystem_String( GParted::FS_XFS ) ) ) ) ; + Utils::get_filesystem_string( GParted::FS_XFS ) ) ) ) ; if ( ! execute_command( "mkfs.xfs -f " + new_partition .get_path(), operation_details .back() .sub_details ) ) {