* decided to use the Supported enum a bit more efficient in checks
  ( doh, big deal :P )
This commit is contained in:
Bart Hakvoort 2005-11-28 17:04:13 +00:00
parent 1bbcf787b1
commit 0e6c78c2b7
10 changed files with 28 additions and 24 deletions

View File

@ -1,3 +1,7 @@
2005-11-28 Bart Hakvoort <hakvoort@cvs.gnome.org>
* decided to use the Supported enum a bit more efficient in checks
( doh, big deal :P )
2005-11-27 Bart Hakvoort <hakvoort@cvs.gnome.org> 2005-11-27 Bart Hakvoort <hakvoort@cvs.gnome.org>
* include/Win_GParted.h, * include/Win_GParted.h,
src/Win_GParted.cc: Added a menu 'Edit' which contains 'Undo' and src/Win_GParted.cc: Added a menu 'Edit' which contains 'Undo' and

View File

@ -57,19 +57,19 @@ void Dialog_Filesystems::Show_Filesystem( const FS & fs )
treerow[ treeview_filesystems_columns .filesystem ] = fs .filesystem ; treerow[ treeview_filesystems_columns .filesystem ] = fs .filesystem ;
treerow[ treeview_filesystems_columns .create ] = treerow[ treeview_filesystems_columns .create ] =
render_icon( fs .create != GParted::FS::NONE ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR); render_icon( fs .create ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR);
treerow[ treeview_filesystems_columns .grow ] = treerow[ treeview_filesystems_columns .grow ] =
render_icon( fs .grow != GParted::FS::NONE ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR ); render_icon( fs .grow ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR );
treerow[ treeview_filesystems_columns .shrink ] = treerow[ treeview_filesystems_columns .shrink ] =
render_icon( fs .shrink != GParted::FS::NONE ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR ); render_icon( fs .shrink ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR );
treerow[ treeview_filesystems_columns .move ] = treerow[ treeview_filesystems_columns .move ] =
render_icon( fs .move != GParted::FS::NONE ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR ); render_icon( fs .move ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR );
treerow[ treeview_filesystems_columns .copy ] = treerow[ treeview_filesystems_columns .copy ] =
render_icon( fs .copy != GParted::FS::NONE ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR ); render_icon( fs .copy ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR );
} }
Dialog_Filesystems::~Dialog_Filesystems( ) Dialog_Filesystems::~Dialog_Filesystems( )

View File

@ -438,11 +438,11 @@ bool GParted_Core::Resize( const Device & device, const Partition & partition_ol
p_filesystem ->cylinder_size = device .cylsize ; p_filesystem ->cylinder_size = device .cylsize ;
if ( p_filesystem ->Resize( partition_new ) ) if ( p_filesystem ->Resize( partition_new ) )
Resize_Container_Partition( device .path, partition_old, partition_new, get_fs( partition_new .filesystem ) .move != GParted::FS::NONE ) ; Resize_Container_Partition( device .path, partition_old, partition_new, ! get_fs( partition_new .filesystem ) .move ) ;
} }
//growing/moving //growing/moving
else else
Resize_Container_Partition( device .path, partition_old, partition_new, get_fs( partition_new .filesystem ) .move != GParted::FS::NONE ) ; Resize_Container_Partition( device .path, partition_old, partition_new, ! get_fs( partition_new .filesystem ) .move ) ;
p_filesystem ->Check_Repair( partition_new ) ; p_filesystem ->Check_Repair( partition_new ) ;

View File

@ -624,11 +624,11 @@ void Win_GParted::Set_Valid_Operations( )
allow_convert( true ) ; allow_convert( true ) ;
//find out if resizing/moving is possible //find out if resizing/moving is possible
if ( (fs .grow != GParted::FS::NONE || fs .shrink != GParted::FS::NONE ) && ! devices[ current_device ] .readonly ) if ( (fs .grow || fs .shrink ) && ! devices[ current_device ] .readonly )
allow_resize( true ) ; allow_resize( true ) ;
//only allow copying of real partitions //only allow copying of real partitions
if ( selected_partition .status == GParted::STAT_REAL && fs .copy != GParted::FS::NONE ) if ( selected_partition .status == GParted::STAT_REAL && fs .copy )
allow_copy( true ) ; allow_copy( true ) ;
return ; return ;

View File

@ -36,15 +36,15 @@ FS ext2::get_filesystem_support( )
fs .check = GParted::FS::EXTERNAL ; fs .check = GParted::FS::EXTERNAL ;
//resizing is a delicate process ... //resizing is a delicate process ...
if ( ! system( "which resize2fs 1>/dev/null 2>/dev/null" ) && fs .check != GParted::FS::NONE ) if ( ! system( "which resize2fs 1>/dev/null 2>/dev/null" ) && fs .check )
{ {
fs .grow = GParted::FS::EXTERNAL ; fs .grow = GParted::FS::EXTERNAL ;
if ( fs .read != GParted::FS::NONE ) //needed to determine a min filesystemsize.. if ( fs .read ) //needed to determine a min filesystemsize..
fs .shrink = GParted::FS::EXTERNAL ; fs .shrink = GParted::FS::EXTERNAL ;
} }
if ( ! system( "which dd 1>/dev/null 2>/dev/null" ) && fs .grow != GParted::FS::NONE ) if ( ! system( "which dd 1>/dev/null 2>/dev/null" ) && fs .grow )
fs .copy = GParted::FS::EXTERNAL ; fs .copy = GParted::FS::EXTERNAL ;
return fs ; return fs ;

View File

@ -36,15 +36,15 @@ FS ext3::get_filesystem_support( )
fs .check = GParted::FS::EXTERNAL ; fs .check = GParted::FS::EXTERNAL ;
//resizing is a delicate process ... //resizing is a delicate process ...
if ( ! system( "which resize2fs 1>/dev/null 2>/dev/null" ) && fs .check != GParted::FS::NONE ) if ( ! system( "which resize2fs 1>/dev/null 2>/dev/null" ) && fs .check )
{ {
fs .grow = GParted::FS::EXTERNAL ; fs .grow = GParted::FS::EXTERNAL ;
if ( fs .read != GParted::FS::NONE ) //needed to determine a min filesystemsize.. if ( fs .read ) //needed to determine a min filesystemsize..
fs .shrink = GParted::FS::EXTERNAL ; fs .shrink = GParted::FS::EXTERNAL ;
} }
if ( ! system( "which dd 1>/dev/null 2>/dev/null" ) && fs .grow != GParted::FS::NONE ) if ( ! system( "which dd 1>/dev/null 2>/dev/null" ) && fs .grow )
fs .copy = GParted::FS::EXTERNAL ; fs .copy = GParted::FS::EXTERNAL ;
return fs ; return fs ;

View File

@ -51,7 +51,7 @@ FS jfs::get_filesystem_support( )
input .close( ) ; input .close( ) ;
} }
if ( ! system( "which dd 1>/dev/null 2>/dev/null" ) && fs .grow != GParted::FS::NONE ) if ( ! system( "which dd 1>/dev/null 2>/dev/null" ) && fs .grow )
fs .copy = GParted::FS::EXTERNAL ; fs .copy = GParted::FS::EXTERNAL ;
fs .MIN = 16 ; fs .MIN = 16 ;

View File

@ -36,16 +36,16 @@ FS ntfs::get_filesystem_support( )
fs .check = GParted::FS::EXTERNAL ; fs .check = GParted::FS::EXTERNAL ;
//resizing is a delicate process ... //resizing is a delicate process ...
if ( ! system( "which ntfsresize 1>/dev/null 2>/dev/null" ) && fs .check != GParted::FS::NONE ) if ( ! system( "which ntfsresize 1>/dev/null 2>/dev/null" ) && fs .check )
{ {
fs .grow = GParted::FS::EXTERNAL ; fs .grow = GParted::FS::EXTERNAL ;
if ( fs .read != GParted::FS::NONE ) //needed to determine a min filesystemsize.. if ( fs .read ) //needed to determine a min filesystemsize..
fs .shrink = GParted::FS::EXTERNAL ; fs .shrink = GParted::FS::EXTERNAL ;
} }
//we need ntfsresize to set correct used/unused after cloning //we need ntfsresize to set correct used/unused after cloning
if ( ! system( "which ntfsclone 1>/dev/null 2>/dev/null" ) && fs .grow != GParted::FS::NONE ) if ( ! system( "which ntfsclone 1>/dev/null 2>/dev/null" ) && fs .grow )
fs .copy = GParted::FS::EXTERNAL ; fs .copy = GParted::FS::EXTERNAL ;
return fs ; return fs ;

View File

@ -37,16 +37,16 @@ FS reiserfs::get_filesystem_support( )
fs .check = GParted::FS::EXTERNAL ; fs .check = GParted::FS::EXTERNAL ;
//resizing is a delicate process ... //resizing is a delicate process ...
if ( ! system( "which resize_reiserfs 1>/dev/null 2>/dev/null" ) && fs .check != GParted::FS::NONE ) if ( ! system( "which resize_reiserfs 1>/dev/null 2>/dev/null" ) && fs .check )
{ {
fs .grow = GParted::FS::EXTERNAL ; fs .grow = GParted::FS::EXTERNAL ;
if ( fs .read != GParted::FS::NONE ) //needed to determine a min filesystemsize.. if ( fs .read ) //needed to determine a min filesystemsize..
fs .shrink = GParted::FS::EXTERNAL ; fs .shrink = GParted::FS::EXTERNAL ;
} }
//we need to call resize_reiserfs after a copy to get proper used/unused //we need to call resize_reiserfs after a copy to get proper used/unused
if ( ! system( "which dd 1>/dev/null 2>/dev/null" ) && fs .grow != GParted::FS::NONE ) if ( ! system( "which dd 1>/dev/null 2>/dev/null" ) && fs .grow )
fs .copy = GParted::FS::EXTERNAL ; fs .copy = GParted::FS::EXTERNAL ;
fs .MIN = 32 ; fs .MIN = 32 ;

View File

@ -37,7 +37,7 @@ FS xfs::get_filesystem_support( )
fs .check = GParted::FS::EXTERNAL ; fs .check = GParted::FS::EXTERNAL ;
//resizing of xfs requires xfs_growfs, xfs_repair, mount, umount and xfs support in the kernel //resizing of xfs requires xfs_growfs, xfs_repair, mount, umount and xfs support in the kernel
if ( ! system( "which xfs_growfs mount umount 1>/dev/null 2>/dev/null" ) && fs .check != GParted::FS::NONE ) if ( ! system( "which xfs_growfs mount umount 1>/dev/null 2>/dev/null" ) && fs .check )
{ {
Glib::ustring line ; Glib::ustring line ;
std::ifstream input( "/proc/filesystems" ) ; std::ifstream input( "/proc/filesystems" ) ;
@ -51,7 +51,7 @@ FS xfs::get_filesystem_support( )
input .close( ) ; input .close( ) ;
} }
if ( ! system( "which xfsdump xfsrestore mount umount 1>/dev/null 2>/dev/null" ) && fs .check != GParted::FS::NONE && fs .create != GParted::FS::NONE ) if ( ! system( "which xfsdump xfsrestore mount umount 1>/dev/null 2>/dev/null" ) && fs .check && fs .create )
fs .copy = GParted::FS::EXTERNAL ; fs .copy = GParted::FS::EXTERNAL ;
fs .MIN = 32 ;//official minsize = 16MB, but the smallest xfs_repair can handle is 32MB... fs .MIN = 32 ;//official minsize = 16MB, but the smallest xfs_repair can handle is 32MB...