diff --git a/ChangeLog b/ChangeLog index f4b0db5a..ea6f6ce9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-03-31 Bart Hakvoort + + * include/GParted_Core.h, + src/GParted_Core.cc: let create_empty_partition() return a boolean + instead of an integer. + 2006-03-31 Bart Hakvoort * include/DialogManageFlags.h, diff --git a/include/GParted_Core.h b/include/GParted_Core.h index 83807ff4..98d2a983 100644 --- a/include/GParted_Core.h +++ b/include/GParted_Core.h @@ -90,9 +90,9 @@ private: std::vector get_alternate_paths( const Glib::ustring & path ) ; void LP_Set_Used_Sectors( Partition & partition ); void set_flags( Partition & partition ) ; - int create_empty_partition( Partition & new_partition, - std::vector & operation_details, - Sector min_size = 0 ) ; + bool create_empty_partition( Partition & new_partition, + std::vector & operation_details, + Sector min_size = 0 ) ; bool resize_container_partition( const Partition & partition_old, const Partition & partition_new, bool fixed_start, diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 4e41131a..4c496714 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -888,10 +888,10 @@ void GParted_Core::LP_Set_Used_Sectors( Partition & partition ) } } -int GParted_Core::create_empty_partition( Partition & new_partition, - std::vector & operation_details, - Sector min_size ) -{//FIXME:make this one return a boolean... +bool GParted_Core::create_empty_partition( Partition & new_partition, + std::vector & operation_details, + Sector min_size ) +{ operation_details .push_back( OperationDetails( _("create empty partition") ) ) ; new_partition .partition_number = 0 ; @@ -988,7 +988,7 @@ int GParted_Core::create_empty_partition( Partition & new_partition, { operation_details .back() .status = OperationDetails::SUCCES ; - return new_partition .partition_number ; + return new_partition .partition_number > 0 ; } else { @@ -998,7 +998,7 @@ int GParted_Core::create_empty_partition( Partition & new_partition, operation_details .back() .status = OperationDetails::ERROR ; - return 0 ; + return false ; } }