From 85e9ddbf48a7870aa594df3d8d0e589cc348c936 Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Fri, 17 Mar 2006 10:07:49 +0000 Subject: [PATCH] moved comment to correct position fixed issues with mountpoints containing * src/GParted_Core.cc: moved comment to correct position * src/Win_GParted.cc: fixed issues with mountpoints containing underscores and/or spaces. --- ChangeLog | 6 ++++++ src/GParted_Core.cc | 3 ++- src/Utils.cc | 2 +- src/Win_GParted.cc | 14 ++++++++++---- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 740fbba4..3640f738 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-03-17 Bart Hakvoort + + * src/GParted_Core.cc: moved comment to correct position + * src/Win_GParted.cc: fixed issues with mountpoints containing + underscores and/or spaces. + 2006-03-16 Bart Hakvoort * src/Win_GParted.cc: fixed visual feedback while mounting a partition diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 33a3246d..ae4fe8d2 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -195,8 +195,9 @@ void GParted_Core::read_mountpoints_from_file( const Glib::ustring & filename, sscanf( line .c_str(), "%255s %255s", node, mountpoint ) == 2 && static_cast( node ) != "/dev/root" ) { - //see if mountpoint contains spaces and deal with it line = mountpoint ; + + //see if mountpoint contains spaces and deal with it index = line .find( "\\040" ) ; if ( index < line .length() ) line .replace( index, 4, " " ) ; diff --git a/src/Utils.cc b/src/Utils.cc index 0e9115f2..86c8523a 100644 --- a/src/Utils.cc +++ b/src/Utils.cc @@ -192,7 +192,7 @@ int Utils::execute_command( const Glib::ustring & command, { int exit_status = -1 ; std::string std_out, std_error ; - + try { if ( use_C_locale ) diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index bf87413c..3baa93b2 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -448,6 +448,9 @@ void Win_GParted::refresh_combo_devices() radio_group, devices[ i ] .get_path() + "\t(" + Utils::format_size( devices[ i ] .length ) + ")", sigc::bind( sigc::mem_fun(*this, &Win_GParted::radio_devices_changed), i ) ) ) ; + + //FIXME: the (size) needs the be rightaligned while the path should remain left-aligned + //i guess this takes 2 labels to achieve.. } @@ -764,12 +767,15 @@ void Win_GParted::set_valid_operations() menu = menu_partition .items()[ 11 ] .get_submenu() ; menu ->items() .clear() ; for ( unsigned int t = 0 ; t < selected_partition .get_mountpoints() .size() ; t++ ) + { menu ->items() .push_back( Gtk::Menu_Helpers::MenuElem( selected_partition .get_mountpoints()[ t ], sigc::bind( sigc::mem_fun(*this, &Win_GParted::activate_mount_partition), t ) ) ); - + dynamic_cast( menu ->items() .back() .get_child() ) ->set_use_underline( false ) ; + } + menu_partition .items()[ 10 ] .hide() ; menu_partition .items()[ 11 ] .show() ; } @@ -1386,7 +1392,7 @@ void Win_GParted::thread_unmount_partition( bool * succes, Glib::ustring * error mountpoints .end(), selected_partition .get_mountpoints()[ t ] ) <= 1 ) { - if ( Utils::execute_command( "umount -v " + selected_partition .get_mountpoints()[ t ], + if ( Utils::execute_command( "umount -v \"" + selected_partition .get_mountpoints()[ t ] + "\"", dummy, *error ) ) { @@ -1415,8 +1421,8 @@ void Win_GParted::thread_mount_partition( Glib::ustring mountpoint, bool * succe { Glib::ustring dummy ; std::vector errors ; - - *succes = ! Utils::execute_command( "mount -v " + selected_partition .get_path() + " " + mountpoint, + + *succes = ! Utils::execute_command( "mount -v " + selected_partition .get_path() + " \"" + mountpoint + "\"", dummy, *error ) ;