From 677a21f50ade33dcd19e3438d63d5db53182db37 Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Sun, 30 Jul 2006 15:13:41 +0000 Subject: [PATCH] improved errorhandling a bit. At the initialscan we store errors/warnings * improved errorhandling a bit. At the initialscan we store errors/warnings now in a list per partition and show the in the partitioninfo dialog. While executing an operation we collect all libparted exceptions in a list and attach this list to the operationdetails when everything is done. --- ChangeLog | 9 ++ include/Dialog_Partition_Info.h | 1 + include/Dialog_Progress.h | 1 + include/OperationDetail.h | 3 +- include/Partition.h | 2 +- src/Dialog_Partition_Info.cc | 43 ++++++---- src/Dialog_Partition_Resize_Move.cc | 3 +- src/Dialog_Progress.cc | 5 ++ src/GParted_Core.cc | 128 +++++++++++++--------------- src/Partition.cc | 2 +- src/TreeView_Detail.cc | 2 +- src/Win_GParted.cc | 6 +- src/ext2.cc | 2 +- src/ext3.cc | 2 +- src/fat16.cc | 2 +- src/fat32.cc | 2 +- src/jfs.cc | 2 +- src/ntfs.cc | 2 +- src/reiser4.cc | 2 +- src/reiserfs.cc | 2 +- src/xfs.cc | 2 +- 21 files changed, 123 insertions(+), 100 deletions(-) diff --git a/ChangeLog b/ChangeLog index 646a3f65..6d00108a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-07-30 Bart Hakvoort + + * improved errorhandling a bit. At the initialscan we store + errors/warnings now in a list per partition and show the in the + partitioninfo dialog. + While executing an operation we collect all libparted exceptions in + a list and attach this list to the operationdetails when everything + is done. + 2006-07-29 Bart Hakvoort * renamed some enums diff --git a/include/Dialog_Partition_Info.h b/include/Dialog_Partition_Info.h index bad4254d..a824369d 100644 --- a/include/Dialog_Partition_Info.h +++ b/include/Dialog_Partition_Info.h @@ -52,6 +52,7 @@ private: Partition partition ; Gtk::HBox *hbox ; + Gtk::VBox *vbox ; Gtk::DrawingArea drawingarea ; Gtk::Frame *frame ; Gtk::Image *image; diff --git a/include/Dialog_Progress.h b/include/Dialog_Progress.h index fc9364c1..a433a062 100644 --- a/include/Dialog_Progress.h +++ b/include/Dialog_Progress.h @@ -66,6 +66,7 @@ private: Glib::RefPtr icon_execute ; Glib::RefPtr icon_succes ; Glib::RefPtr icon_error ; + Glib::RefPtr icon_info ; Glib::RefPtr icon_n_a ; Glib::RefPtr treestore_operations; diff --git a/include/OperationDetail.h b/include/OperationDetail.h index fa7bdf83..659fc189 100644 --- a/include/OperationDetail.h +++ b/include/OperationDetail.h @@ -31,7 +31,8 @@ enum OperationDetailStatus { STATUS_EXECUTE = 1, STATUS_SUCCES = 2, STATUS_ERROR = 3, - STATUS_N_A = 4 + STATUS_INFO = 4, + STATUS_N_A = 5 }; enum Font { diff --git a/include/Partition.h b/include/Partition.h index 32548cac..7c33f26e 100644 --- a/include/Partition.h +++ b/include/Partition.h @@ -103,7 +103,7 @@ public: Gdk::Color color; bool inside_extended; bool busy; - Glib::ustring error; + std::vector messages ; std::vector flags ; std::vector logicals ; diff --git a/src/Dialog_Partition_Info.cc b/src/Dialog_Partition_Info.cc index 1bb31698..b91fbe07 100644 --- a/src/Dialog_Partition_Info.cc +++ b/src/Dialog_Partition_Info.cc @@ -35,8 +35,8 @@ Dialog_Partition_Info::Dialog_Partition_Info( const Partition & partition ) //add label for detail and fill with relevant info Display_Info() ; - //display error (if any) - if ( partition .error != "" ) + //display messages (if any) + if ( partition .messages .size() > 0 ) { frame = manage( new Gtk::Frame() ); frame ->set_border_width( 10 ); @@ -45,12 +45,23 @@ Dialog_Partition_Info::Dialog_Partition_Info( const Partition & partition ) hbox = manage( new Gtk::HBox() ); hbox ->pack_start( *image, Gtk::PACK_SHRINK ) ; - hbox ->pack_start( * Utils::mk_label( " " + static_cast(_( "Warning:") ) + " " ), + hbox ->pack_start( * Utils::mk_label( " " + Glib::ustring(_("Warning:") ) + " " ), Gtk::PACK_SHRINK ) ; - + + frame ->set_label_widget( *hbox ) ; - frame ->add( * Utils::mk_label( - "" + partition .error + "", true, Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, true ) ) ; + //FIXME: for more clarity we should add a listview here with alternating rowcolors.. + //that way it's easier to tell messages apart.. + vbox = manage( new Gtk::VBox( false, 4 ) ); + vbox ->set_border_width( 5 ) ; + for ( unsigned int t = 0 ; t < partition .messages .size() ; t++ ) + vbox ->pack_start( * Utils::mk_label( "" + partition .messages[t] + "", + true, + Gtk::ALIGN_LEFT, + Gtk::ALIGN_CENTER, + true ), + Gtk::PACK_SHRINK ) ; + frame ->add( *vbox ) ; this ->get_vbox() ->pack_start( *frame, Gtk::PACK_SHRINK ) ; } @@ -137,7 +148,7 @@ void Dialog_Partition_Info::Display_Info() this ->get_vbox() ->pack_start( *table, Gtk::PACK_SHRINK ) ; //filesystem - table ->attach( * Utils::mk_label( "" + static_cast( _("Filesystem:") ) + "" ), + table ->attach( * Utils::mk_label( "" + Glib::ustring( _("Filesystem:") ) + "" ), 0, 1, top, bottom, Gtk::FILL ) ; @@ -147,7 +158,7 @@ void Dialog_Partition_Info::Display_Info() Gtk::FILL ) ; //size - table ->attach( * Utils::mk_label( "" + static_cast( _("Size:") ) + "" ), + table ->attach( * Utils::mk_label( "" + Glib::ustring( _("Size:") ) + "" ), 0, 1, top, bottom, Gtk::FILL) ; @@ -163,7 +174,7 @@ void Dialog_Partition_Info::Display_Info() Utils::round( partition .sectors_used / static_cast( partition .get_length() ) * 100 ) ; //used - table ->attach( * Utils::mk_label( "" + static_cast( _("Used:") ) + "" ), + table ->attach( * Utils::mk_label( "" + Glib::ustring( _("Used:") ) + "" ), 0, 1, top, bottom, Gtk::FILL ) ; @@ -177,7 +188,7 @@ void Dialog_Partition_Info::Display_Info() Gtk::FILL ) ; //unused - table ->attach( * Utils::mk_label( "" + static_cast( _("Unused:") ) + "" ), + table ->attach( * Utils::mk_label( "" + Glib::ustring( _("Unused:") ) + "" ), 0, 1, top, bottom, Gtk::FILL ) ; @@ -194,7 +205,7 @@ void Dialog_Partition_Info::Display_Info() //flags if ( partition.type != GParted::TYPE_UNALLOCATED ) { - table ->attach( * Utils::mk_label( "" + static_cast( _("Flags:") ) + "" ), + table ->attach( * Utils::mk_label( "" + Glib::ustring( _("Flags:") ) + "" ), 0, 1, top, bottom, Gtk::FILL ) ; @@ -210,7 +221,7 @@ void Dialog_Partition_Info::Display_Info() if ( partition .type != GParted::TYPE_UNALLOCATED && partition .status != GParted::STAT_NEW ) { //path - table ->attach( * Utils::mk_label( "" + static_cast( _("Path:") ) + "", + table ->attach( * Utils::mk_label( "" + Glib::ustring( _("Path:") ) + "", true, Gtk::ALIGN_LEFT, Gtk::ALIGN_TOP ), @@ -224,7 +235,7 @@ void Dialog_Partition_Info::Display_Info() //status Glib::ustring str_temp ; - table ->attach( * Utils::mk_label( "" + static_cast( _("Status:") ) + "" ), + table ->attach( * Utils::mk_label( "" + Glib::ustring( _("Status:") ) + "" ), 0, 1, top, bottom, Gtk::FILL ) ; @@ -252,7 +263,7 @@ void Dialog_Partition_Info::Display_Info() table ->attach( * Utils::mk_label( "" ), 1, 2, top++, bottom++, Gtk::FILL ) ; //first sector - table ->attach( * Utils::mk_label( "" + static_cast( _("First Sector:") ) + "" ), + table ->attach( * Utils::mk_label( "" + Glib::ustring( _("First Sector:") ) + "" ), 0, 1, top, bottom, Gtk::FILL ) ; @@ -262,7 +273,7 @@ void Dialog_Partition_Info::Display_Info() Gtk::FILL ) ; //last sector - table ->attach( * Utils::mk_label( "" + static_cast( _("Last Sector:") ) + "" ), + table ->attach( * Utils::mk_label( "" + Glib::ustring( _("Last Sector:") ) + "" ), 0, 1, top, bottom, Gtk::FILL ) ; @@ -272,7 +283,7 @@ void Dialog_Partition_Info::Display_Info() Gtk::FILL ) ; //total sectors - table ->attach( * Utils::mk_label( "" + static_cast( _("Total Sectors:") ) + "" ), + table ->attach( * Utils::mk_label( "" + Glib::ustring( _("Total Sectors:") ) + "" ), 0, 1, top, bottom, Gtk::FILL ) ; diff --git a/src/Dialog_Partition_Resize_Move.cc b/src/Dialog_Partition_Resize_Move.cc index 92036b07..68e1a7af 100644 --- a/src/Dialog_Partition_Resize_Move.cc +++ b/src/Dialog_Partition_Resize_Move.cc @@ -61,7 +61,8 @@ void Dialog_Partition_Resize_Move::Set_Data( const Partition & selected_partitio void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vector & partitions ) { - if ( ! selected_partition .error .empty() ) + //little bit of paranoia ;) + if ( selected_partition .sectors_used == -1 ) fs .shrink = GParted::FS::NONE ; //see if we need a fixed_start diff --git a/src/Dialog_Progress.cc b/src/Dialog_Progress.cc index 5a051e56..7b083ea6 100644 --- a/src/Dialog_Progress.cc +++ b/src/Dialog_Progress.cc @@ -61,6 +61,7 @@ Dialog_Progress::Dialog_Progress( const std::vector & operations ) icon_execute = render_icon( Gtk::Stock::EXECUTE, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ; icon_succes = render_icon( Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ; icon_error = render_icon( Gtk::Stock::DIALOG_ERROR, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ; + icon_info = render_icon( Gtk::Stock::INFO, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ; icon_n_a = render_icon( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ; treestore_operations = Gtk::TreeStore::create( treeview_operations_columns ); @@ -141,6 +142,10 @@ void Dialog_Progress::update_operation_details( const Gtk::TreeRow & treerow, case STATUS_ERROR: treerow[ treeview_operations_columns .status_icon ] = icon_error ; + break ; + case STATUS_INFO: + treerow[ treeview_operations_columns .status_icon ] = icon_info ; + break ; case STATUS_N_A: treerow[ treeview_operations_columns .status_icon ] = icon_n_a ; diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 95794790..71bd5117 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -40,7 +40,7 @@ #include #include -Glib::ustring ped_error ; //see e.g. ped_exception_handler() +std::vector libparted_messages ; //see ped_exception_handler() namespace GParted { @@ -283,31 +283,49 @@ bool GParted_Core::snap_to_cylinder( const Device & device, Partition & partitio bool GParted_Core::apply_operation_to_disk( Operation * operation ) { + bool succes = false ; + libparted_messages .clear() ; + switch ( operation ->type ) { case OPERATION_DELETE: - return Delete( operation ->partition_original, operation ->operation_detail .sub_details ) ; + succes = Delete( operation ->partition_original, operation ->operation_detail .sub_details ) ; + break ; case OPERATION_CREATE: - return create( operation ->device, - operation ->partition_new, - operation ->operation_detail .sub_details ) ; + succes = create( operation ->device, + operation ->partition_new, + operation ->operation_detail .sub_details ) ; + break ; case OPERATION_RESIZE_MOVE: - return resize_move( operation ->device, - operation ->partition_original, - operation ->partition_new, - operation ->operation_detail .sub_details ) ; + succes = resize_move( operation ->device, + operation ->partition_original, + operation ->partition_new, + operation ->operation_detail .sub_details ) ; + break ; case OPERATION_FORMAT: - return format( operation ->partition_new, operation ->operation_detail .sub_details ) ; + succes = format( operation ->partition_new, operation ->operation_detail .sub_details ) ; + break ; case OPERATION_COPY: operation ->partition_new .add_path( operation ->partition_original .get_path(), true ) ; - return copy( static_cast( operation ) ->partition_copied, - operation ->partition_new, - static_cast( operation ) ->partition_copied .get_length(), - static_cast( operation ) ->block_size, - operation ->operation_detail .sub_details ) ; + succes = copy( static_cast( operation ) ->partition_copied, + operation ->partition_new, + static_cast( operation ) ->partition_copied .get_length(), + static_cast( operation ) ->block_size, + operation ->operation_detail .sub_details ) ; + break ; } - return false ; + if ( ! succes && libparted_messages .size() > 0 ) + { + operation ->operation_detail .sub_details .push_back( + OperationDetail( _("libparted messages"), STATUS_INFO ) ) ; + + for ( unsigned int t = 0 ; t < libparted_messages .size() ; t++ ) + operation ->operation_detail .sub_details .back() .sub_details .push_back( + OperationDetail( libparted_messages[ t ], STATUS_NONE, FONT_ITALIC ) ) ; + } + + return succes ; } bool GParted_Core::set_disklabel( const Glib::ustring & device_path, const Glib::ustring & disklabel ) @@ -563,6 +581,7 @@ void GParted_Core::set_device_partitions( Device & device ) lp_partition = ped_disk_next_partition( lp_disk, NULL ) ; while ( lp_partition ) { + libparted_messages .clear() ; partition_temp .Reset() ; switch ( lp_partition ->type ) @@ -612,6 +631,10 @@ void GParted_Core::set_device_partitions( Device & device ) default: break; } + + partition_temp .messages .insert( partition_temp .messages .end(), + libparted_messages. begin(), + libparted_messages .end() ) ; //if there's an end, there's a partition ;) if ( partition_temp .sector_end > -1 ) @@ -621,7 +644,7 @@ void GParted_Core::set_device_partitions( Device & device ) else device .partitions[ EXT_INDEX ] .logicals .push_back( partition_temp ) ; } - + //next partition (if any) lp_partition = ped_disk_next_partition( lp_disk, lp_partition ) ; } @@ -683,14 +706,16 @@ GParted::FILESYSTEM GParted_Core::get_filesystem() return GParted::FS_REISER4 ; //no filesystem found.... - partition_temp .error = _( "Unable to detect filesystem! Possible reasons are:" ) ; - partition_temp .error += "\n-"; - partition_temp .error += _( "The filesystem is damaged" ) ; - partition_temp .error += "\n-" ; - partition_temp .error += _( "The filesystem is unknown to GParted" ) ; - partition_temp .error += "\n-"; - partition_temp .error += _( "There is no filesystem available (unformatted)" ) ; - + temp = _( "Unable to detect filesystem! Possible reasons are:" ) ; + temp += "\n-"; + temp += _( "The filesystem is damaged" ) ; + temp += "\n-" ; + temp += _( "The filesystem is unknown to GParted" ) ; + temp += "\n-"; + temp += _( "There is no filesystem available (unformatted)" ) ; + + partition_temp .messages .push_back( temp ) ; + return GParted::FS_UNKNOWN ; } @@ -764,7 +789,7 @@ void GParted_Core::set_mountpoints( std::vector & partitions ) } if ( partitions[ t ] .get_mountpoints() .empty() ) - partitions[ t ] .error = _("Unable to find mountpoint") ; + partitions[ t ] .messages .push_back( _("Unable to find mountpoint") ) ; } else { @@ -785,8 +810,6 @@ void GParted_Core::set_used_sectors( std::vector & partitions ) temp = _("Unable to read the contents of this filesystem!") ; temp += "\n" ; temp += _("Because of this some operations may be unavailable.") ; - temp += "\n\n" ; - temp += _("Did you install the correct plugin for this filesystem?") ; for ( unsigned int t = 0 ; t < partitions .size() ; t++ ) { @@ -799,15 +822,15 @@ void GParted_Core::set_used_sectors( std::vector & partitions ) if ( partitions[ t ] .busy ) { if ( partitions[ t ] .get_mountpoints() .size() > 0 ) - { + { if ( statvfs( partitions[ t ] .get_mountpoint() .c_str(), &sfs ) == 0 ) partitions[ t ] .Set_Unused( sfs .f_bfree * (sfs .f_bsize / 512) ) ; else - partitions[ t ] .error = + partitions[ t ] .messages .push_back( "statvfs (" + partitions[ t ] .get_mountpoint() + "): " + - Glib::strerror( errno ) ; + Glib::strerror( errno ) ) ; } } else @@ -827,8 +850,8 @@ void GParted_Core::set_used_sectors( std::vector & partitions ) } } - if ( partitions[ t ] .sectors_used == -1 && partitions[ t ] .error .empty() ) - partitions[ t ] .error = temp ; + if ( partitions[ t ] .sectors_used == -1 ) + partitions[ t ] .messages .push_back( temp ) ; } else if ( partitions[ t ] .type == GParted::TYPE_EXTENDED ) @@ -866,9 +889,6 @@ void GParted_Core::LP_set_used_sectors( Partition & partition ) } } } - - if ( partition .sectors_used == -1 ) - partition .error = ped_error ; } void GParted_Core::set_flags( Partition & partition ) @@ -883,7 +903,6 @@ bool GParted_Core::create( const Device & device, Partition & new_partition, std::vector & operation_details ) { - if ( new_partition .type == GParted::TYPE_EXTENDED ) { return create_partition( new_partition, operation_details ) ; @@ -907,7 +926,6 @@ bool GParted_Core::create_partition( Partition & new_partition, operation_details .push_back( OperationDetail( _("create empty partition") ) ) ; new_partition .partition_number = 0 ; - ped_error .clear() ; if ( open_device_and_disk( new_partition .device_path ) ) { @@ -1007,10 +1025,6 @@ bool GParted_Core::create_partition( Partition & new_partition, } else { - if ( ! ped_error .empty() ) - operation_details .back() .sub_details .push_back( - OperationDetail( ped_error, STATUS_NONE, FONT_ITALIC ) ) ; - operation_details .back() .status = STATUS_ERROR ; return false ; @@ -1064,7 +1078,7 @@ bool GParted_Core::Delete( const Partition & partition, std::vector end) //ped_disk_set_partition_geom() will still return true (althoug an lp exception is written //to stdout.. see if this also affect create_partition and resize_move_partition + //sended a patch to fix this to libparted list. will probably be in 1.7.2 if ( ped_disk_set_partition_geom( lp_disk, lp_partition, constraint, @@ -1935,9 +1934,6 @@ bool GParted_Core::calculate_exact_geom( const Partition & partition_old, STATUS_NONE, FONT_ITALIC ) ) ; } - else if ( ! ped_error .empty() ) - operation_details .back() .sub_details .push_back( - OperationDetail( ped_error, STATUS_NONE, FONT_ITALIC ) ) ; operation_details .back() .status = succes ? STATUS_SUCCES : STATUS_ERROR ; return succes ; @@ -2018,9 +2014,6 @@ bool GParted_Core::erase_filesystem_signatures( const Partition & partition ) //FIXME open_device( _and_disk) and the close functions should take an PedDevice * and PedDisk * as argument //basicly we should get rid of these global lp_device and lp_disk -//also, it would be cool to create another open_device_and_disk() which also accepts an operation_details.... -//we don't have to show the opening as an operation in itself, but we could use it to report errors which might -//occur while opening the device or disk. bool GParted_Core::open_device( const Glib::ustring & device_path ) { lp_device = ped_device_get( device_path .c_str() ); @@ -2078,8 +2071,9 @@ bool GParted_Core::commit() PedExceptionOption GParted_Core::ped_exception_handler( PedException * e ) { std::cout << e ->message << std::endl ; - ped_error = e ->message ; - + + libparted_messages .push_back( e->message ) ; + return PED_EXCEPTION_UNHANDLED ; } diff --git a/src/Partition.cc b/src/Partition.cc index 8ef2aaa8..2470c321 100644 --- a/src/Partition.cc +++ b/src/Partition.cc @@ -35,7 +35,7 @@ Partition::Partition( const Glib::ustring & path ) void Partition::Reset() { paths .clear() ; - error .clear() ; + messages .clear() ; status = GParted::STAT_REAL ; type = GParted::TYPE_UNALLOCATED ; filesystem = GParted::FS_UNALLOCATED ; diff --git a/src/TreeView_Detail.cc b/src/TreeView_Detail.cc index 80e7a454..5c616ad8 100644 --- a/src/TreeView_Detail.cc +++ b/src/TreeView_Detail.cc @@ -152,7 +152,7 @@ void TreeView_Detail::create_row( const Gtk::TreeRow & treerow, const Partition treerow[ treeview_detail_columns .icon1 ] = render_icon( Gtk::Stock::DIALOG_AUTHENTICATION, Gtk::ICON_SIZE_BUTTON ); - if ( ! partition .error .empty() ) + if ( partition .messages .size() > 0 ) { if ( ! static_cast< Glib::RefPtr >( treerow[ treeview_detail_columns .icon1 ] ) ) treerow[ treeview_detail_columns .icon1 ] = diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index 52f9f7f6..9bd529e1 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -1289,8 +1289,8 @@ void Win_GParted::activate_paste() { Dialog_Partition_Copy dialog( gparted_core .get_fs( copied_partition .filesystem ), devices[ current_device ] .cylsize ) ; - //we don't need the errors/mountpoints of the source partition. - copied_partition .error .clear() ; + //we don't need the messages/mountpoints of the source partition. + copied_partition .messages .clear() ; copied_partition .clear_mountpoints() ; dialog .Set_Data( selected_partition, copied_partition ) ; dialog .set_transient_for( *this ); @@ -1308,7 +1308,7 @@ void Win_GParted::activate_paste() partition_new .filesystem = copied_partition .filesystem ; partition_new .color = copied_partition .color ; partition_new .set_used( copied_partition .sectors_used ) ; - partition_new .error .clear() ; + partition_new .messages .clear() ; partition_new .status = GParted::STAT_COPY ; //FIXME: in this case there's no window presented to the user, so he cannot choose the blocksize diff --git a/src/ext2.cc b/src/ext2.cc index 33bd4ffd..363a0b6c 100644 --- a/src/ext2.cc +++ b/src/ext2.cc @@ -69,7 +69,7 @@ void ext2::Set_Used_Sectors( Partition & partition ) partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else - partition .error = error ; + partition .messages .push_back( error ) ; } bool ext2::Create( const Partition & new_partition, std::vector & operation_details ) diff --git a/src/ext3.cc b/src/ext3.cc index 20ff7fb1..127d9cdc 100644 --- a/src/ext3.cc +++ b/src/ext3.cc @@ -70,7 +70,7 @@ void ext3::Set_Used_Sectors( Partition & partition ) partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else - partition .error = error ; + partition .messages .push_back( error ) ; } bool ext3::Create( const Partition & new_partition, std::vector & operation_details ) diff --git a/src/fat16.cc b/src/fat16.cc index 3ef246ce..5035fb24 100644 --- a/src/fat16.cc +++ b/src/fat16.cc @@ -70,7 +70,7 @@ void fat16::Set_Used_Sectors( Partition & partition ) partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else - partition .error = error ; + partition .messages .push_back( error ) ; } bool fat16::Create( const Partition & new_partition, std::vector & operation_details ) diff --git a/src/fat32.cc b/src/fat32.cc index b2fd7b7a..a81e9510 100644 --- a/src/fat32.cc +++ b/src/fat32.cc @@ -69,7 +69,7 @@ void fat32::Set_Used_Sectors( Partition & partition ) partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else - partition .error = error ; + partition .messages .push_back( error ) ; } bool fat32::Create( const Partition & new_partition, std::vector & operation_details ) diff --git a/src/jfs.cc b/src/jfs.cc index 4adc4025..651573d0 100644 --- a/src/jfs.cc +++ b/src/jfs.cc @@ -90,7 +90,7 @@ void jfs::Set_Used_Sectors( Partition & partition ) partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else - partition .error = error ; + partition .messages .push_back( error ) ; } bool jfs::Create( const Partition & new_partition, std::vector & operation_details ) diff --git a/src/ntfs.cc b/src/ntfs.cc index 749372fc..c689ebb0 100644 --- a/src/ntfs.cc +++ b/src/ntfs.cc @@ -67,7 +67,7 @@ void ntfs::Set_Used_Sectors( Partition & partition ) partition .Set_Unused( N ) ; } else - partition .error = error ; + partition .messages .push_back( error ) ; } bool ntfs::Create( const Partition & new_partition, std::vector & operation_details ) diff --git a/src/reiser4.cc b/src/reiser4.cc index ac6aed56..d68d39ba 100644 --- a/src/reiser4.cc +++ b/src/reiser4.cc @@ -68,7 +68,7 @@ void reiser4::Set_Used_Sectors( Partition & partition ) partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else - partition .error = error ; + partition .messages .push_back( error ) ; } bool reiser4::Create( const Partition & new_partition, std::vector & operation_details ) diff --git a/src/reiserfs.cc b/src/reiserfs.cc index 1d15faa2..6206418b 100644 --- a/src/reiserfs.cc +++ b/src/reiserfs.cc @@ -73,7 +73,7 @@ void reiserfs::Set_Used_Sectors( Partition & partition ) partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else - partition .error = error ; + partition .messages .push_back( error ) ; } bool reiserfs::Create( const Partition & new_partition, std::vector & operation_details ) diff --git a/src/xfs.cc b/src/xfs.cc index 27e6d50d..ab81afcb 100644 --- a/src/xfs.cc +++ b/src/xfs.cc @@ -92,7 +92,7 @@ void xfs::Set_Used_Sectors( Partition & partition ) partition .Set_Unused( Utils::round( N * ( S / 512.0 ) ) ) ; } else - partition .error = error ; + partition .messages .push_back( error ) ; } bool xfs::Create( const Partition & new_partition, std::vector & operation_details )