diff --git a/ChangeLog b/ChangeLog index bc4783fb..9d19723b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-11-28 Bart Hakvoort + * decided to use the Supported enum a bit more efficient in checks + ( doh, big deal :P ) + 2005-11-27 Bart Hakvoort * include/Win_GParted.h, src/Win_GParted.cc: Added a menu 'Edit' which contains 'Undo' and diff --git a/src/Dialog_Filesystems.cc b/src/Dialog_Filesystems.cc index 8d6994d6..9b3f9e2c 100644 --- a/src/Dialog_Filesystems.cc +++ b/src/Dialog_Filesystems.cc @@ -57,19 +57,19 @@ void Dialog_Filesystems::Show_Filesystem( const FS & fs ) treerow[ treeview_filesystems_columns .filesystem ] = fs .filesystem ; 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 ] = - 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 ] = - 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 ] = - 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 ] = - 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( ) diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 7778a118..64962043 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -438,11 +438,11 @@ bool GParted_Core::Resize( const Device & device, const Partition & partition_ol p_filesystem ->cylinder_size = device .cylsize ; 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 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 ) ; diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index f0a01541..ea39284b 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -624,11 +624,11 @@ void Win_GParted::Set_Valid_Operations( ) allow_convert( true ) ; //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 ) ; //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 ) ; return ; diff --git a/src/ext2.cc b/src/ext2.cc index 7b5e06d3..6fe84162 100644 --- a/src/ext2.cc +++ b/src/ext2.cc @@ -36,15 +36,15 @@ FS ext2::get_filesystem_support( ) fs .check = GParted::FS::EXTERNAL ; //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 ; - 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 ; } - 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 ; return fs ; diff --git a/src/ext3.cc b/src/ext3.cc index 52f67b9d..3a19b5e8 100644 --- a/src/ext3.cc +++ b/src/ext3.cc @@ -36,15 +36,15 @@ FS ext3::get_filesystem_support( ) fs .check = GParted::FS::EXTERNAL ; //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 ; - 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 ; } - 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 ; return fs ; diff --git a/src/jfs.cc b/src/jfs.cc index e87e3fbf..55fdc371 100644 --- a/src/jfs.cc +++ b/src/jfs.cc @@ -51,7 +51,7 @@ FS jfs::get_filesystem_support( ) 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 .MIN = 16 ; diff --git a/src/ntfs.cc b/src/ntfs.cc index 0ab7c65c..f9e4e6a0 100644 --- a/src/ntfs.cc +++ b/src/ntfs.cc @@ -36,16 +36,16 @@ FS ntfs::get_filesystem_support( ) fs .check = GParted::FS::EXTERNAL ; //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 ; - 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 ; } //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 ; return fs ; diff --git a/src/reiserfs.cc b/src/reiserfs.cc index e7afcc25..e8ba9d85 100644 --- a/src/reiserfs.cc +++ b/src/reiserfs.cc @@ -37,16 +37,16 @@ FS reiserfs::get_filesystem_support( ) fs .check = GParted::FS::EXTERNAL ; //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 ; - 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 ; } //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 .MIN = 32 ; diff --git a/src/xfs.cc b/src/xfs.cc index e64326f2..ac31c1de 100644 --- a/src/xfs.cc +++ b/src/xfs.cc @@ -37,7 +37,7 @@ FS xfs::get_filesystem_support( ) fs .check = GParted::FS::EXTERNAL ; //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 ; std::ifstream input( "/proc/filesystems" ) ; @@ -51,7 +51,7 @@ FS xfs::get_filesystem_support( ) 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 .MIN = 32 ;//official minsize = 16MB, but the smallest xfs_repair can handle is 32MB...