added some checks before performing a move/resize using libparted.

* src/GParted_Core.cc: added some checks before performing a
  move/resize using libparted.
This commit is contained in:
Bart Hakvoort 2006-02-18 16:03:29 +00:00
parent 9c90646b5c
commit 3ba06ea301
2 changed files with 24 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2006-02-18 Bart Hakvoort <hakvoort@cvs.gnome.org>
* src/GParted_Core.cc: added some checks before performing a
move/resize using libparted.
2006-02-18 Bart Hakvoort <hakvoort@cvs.gnome.org> 2006-02-18 Bart Hakvoort <hakvoort@cvs.gnome.org>
* src/Win_GParted.cc: added shortcut to menuitem * src/Win_GParted.cc: added shortcut to menuitem

View File

@ -609,15 +609,25 @@ bool GParted_Core::resize( const Device & device,
if ( partition_old .type == GParted::TYPE_EXTENDED ) if ( partition_old .type == GParted::TYPE_EXTENDED )
return resize_container_partition( partition_old, partition_new, false, operation_details ) ; return resize_container_partition( partition_old, partition_new, false, operation_details ) ;
//resize using libparted..
//FIXME: let's add some checks before and after calling resize_normal_using_libparted()
if ( get_fs( partition_old .filesystem ) .grow == GParted::FS::LIBPARTED )
return resize_normal_using_libparted( partition_old, partition_new, operation_details ) ;
//use custom resize tools..
bool succes = false ; bool succes = false ;
set_proper_filesystem( partition_new .filesystem ) ; set_proper_filesystem( partition_new .filesystem ) ;
//resize using libparted..
if ( get_fs( partition_old .filesystem ) .grow == GParted::FS::LIBPARTED )
{
if ( p_filesystem && p_filesystem ->Check_Repair( partition_new, operation_details ) )
{
succes = resize_normal_using_libparted( partition_old, partition_new, operation_details ) ;
//always check after a resize, but if it failes the whole operation failes
if ( ! p_filesystem ->Check_Repair( partition_new, operation_details ) )
succes = false ;
}
return succes ;
}
//use custom resize tools..
if ( p_filesystem && p_filesystem ->Check_Repair( partition_new, operation_details ) ) if ( p_filesystem && p_filesystem ->Check_Repair( partition_new, operation_details ) )
{ {
succes = true ; succes = true ;
@ -645,9 +655,11 @@ bool GParted_Core::resize( const Device & device,
if ( ! p_filesystem ->Check_Repair( partition_new, operation_details ) ) if ( ! p_filesystem ->Check_Repair( partition_new, operation_details ) )
succes = false ; succes = false ;
}
return succes ; return succes ;
}
return false ;
} }
bool GParted_Core::copy( const Glib::ustring & src_part_path, bool GParted_Core::copy( const Glib::ustring & src_part_path,