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.
This commit is contained in:
Bart Hakvoort 2006-03-17 10:07:49 +00:00
parent dace15d3f6
commit 85e9ddbf48
4 changed files with 19 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2006-03-17 Bart Hakvoort <hakvoort@cvs.gnome.org>
* 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 <hakvoort@cvs.gnome.org> 2006-03-16 Bart Hakvoort <hakvoort@cvs.gnome.org>
* src/Win_GParted.cc: fixed visual feedback while mounting a partition * src/Win_GParted.cc: fixed visual feedback while mounting a partition

View File

@ -195,8 +195,9 @@ void GParted_Core::read_mountpoints_from_file( const Glib::ustring & filename,
sscanf( line .c_str(), "%255s %255s", node, mountpoint ) == 2 && sscanf( line .c_str(), "%255s %255s", node, mountpoint ) == 2 &&
static_cast<Glib::ustring>( node ) != "/dev/root" ) static_cast<Glib::ustring>( node ) != "/dev/root" )
{ {
//see if mountpoint contains spaces and deal with it
line = mountpoint ; line = mountpoint ;
//see if mountpoint contains spaces and deal with it
index = line .find( "\\040" ) ; index = line .find( "\\040" ) ;
if ( index < line .length() ) if ( index < line .length() )
line .replace( index, 4, " " ) ; line .replace( index, 4, " " ) ;

View File

@ -448,6 +448,9 @@ void Win_GParted::refresh_combo_devices()
radio_group, radio_group,
devices[ i ] .get_path() + "\t(" + Utils::format_size( devices[ i ] .length ) + ")", devices[ i ] .get_path() + "\t(" + Utils::format_size( devices[ i ] .length ) + ")",
sigc::bind<unsigned int>( sigc::mem_fun(*this, &Win_GParted::radio_devices_changed), i ) ) ) ; sigc::bind<unsigned int>( 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,11 +767,14 @@ void Win_GParted::set_valid_operations()
menu = menu_partition .items()[ 11 ] .get_submenu() ; menu = menu_partition .items()[ 11 ] .get_submenu() ;
menu ->items() .clear() ; menu ->items() .clear() ;
for ( unsigned int t = 0 ; t < selected_partition .get_mountpoints() .size() ; t++ ) for ( unsigned int t = 0 ; t < selected_partition .get_mountpoints() .size() ; t++ )
{
menu ->items() .push_back( menu ->items() .push_back(
Gtk::Menu_Helpers::MenuElem( Gtk::Menu_Helpers::MenuElem(
selected_partition .get_mountpoints()[ t ], selected_partition .get_mountpoints()[ t ],
sigc::bind<unsigned int>( sigc::mem_fun(*this, &Win_GParted::activate_mount_partition), t ) ) ); sigc::bind<unsigned int>( sigc::mem_fun(*this, &Win_GParted::activate_mount_partition), t ) ) );
dynamic_cast<Gtk::Label*>( menu ->items() .back() .get_child() ) ->set_use_underline( false ) ;
}
menu_partition .items()[ 10 ] .hide() ; menu_partition .items()[ 10 ] .hide() ;
menu_partition .items()[ 11 ] .show() ; menu_partition .items()[ 11 ] .show() ;
@ -1386,7 +1392,7 @@ void Win_GParted::thread_unmount_partition( bool * succes, Glib::ustring * error
mountpoints .end(), mountpoints .end(),
selected_partition .get_mountpoints()[ t ] ) <= 1 ) 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, dummy,
*error ) ) *error ) )
{ {
@ -1416,7 +1422,7 @@ void Win_GParted::thread_mount_partition( Glib::ustring mountpoint, bool * succe
Glib::ustring dummy ; Glib::ustring dummy ;
std::vector<Glib::ustring> errors ; std::vector<Glib::ustring> errors ;
*succes = ! Utils::execute_command( "mount -v " + selected_partition .get_path() + " " + mountpoint, *succes = ! Utils::execute_command( "mount -v " + selected_partition .get_path() + " \"" + mountpoint + "\"",
dummy, dummy,
*error ) ; *error ) ;