Time and check commands setting fat16/32 labels and UUIDs (#754684)

Replace open coding of the creation of the operation details for the
mlabel command used to set the label and UUID with calls to
FileSystem::execute_command() which will do it all.  This also results
in the commands getting a time and check mark displayed in the operation
details.

Bug 754684 - Updates to FileSystem:: and Utils::execute_command()
             functions
This commit is contained in:
Mike Fleetwood 2015-09-05 13:29:10 +01:00 committed by Curtis Gedak
parent 3eccd01f42
commit a202b4569a
1 changed files with 2 additions and 22 deletions

View File

@ -195,17 +195,7 @@ bool fat16::write_label( const Partition & partition, OperationDetail & operatio
else else
cmd = "mlabel ::\"" + pad_label( partition.get_filesystem_label() ) + "\" -i " + partition.get_path(); cmd = "mlabel ::\"" + pad_label( partition.get_filesystem_label() ) + "\" -i " + partition.get_path();
operationdetail .add_child( OperationDetail( cmd, STATUS_NONE, FONT_BOLD_ITALIC ) ) ; return ! execute_command( cmd, operationdetail, EXEC_CHECK_STATUS );
int exit_status = Utils::execute_command( cmd, output, error ) ;
if ( ! output .empty() )
operationdetail .get_last_child() .add_child( OperationDetail( output, STATUS_NONE, FONT_ITALIC ) ) ;
if ( ! error .empty() )
operationdetail .get_last_child() .add_child( OperationDetail( error, STATUS_NONE, FONT_ITALIC ) ) ;
return ( exit_status == 0 );
} }
void fat16::read_uuid( Partition & partition ) void fat16::read_uuid( Partition & partition )
@ -232,17 +222,7 @@ bool fat16::write_uuid( const Partition & partition, OperationDetail & operation
{ {
Glib::ustring cmd = "mlabel -s -n :: -i " + partition.get_path(); Glib::ustring cmd = "mlabel -s -n :: -i " + partition.get_path();
operationdetail .add_child( OperationDetail( cmd, STATUS_NONE, FONT_BOLD_ITALIC ) ) ; return ! execute_command( cmd, operationdetail, EXEC_CHECK_STATUS );
int exit_status = Utils::execute_command( cmd, output, error ) ;
if ( ! output .empty() )
operationdetail .get_last_child() .add_child( OperationDetail( output, STATUS_NONE, FONT_ITALIC ) ) ;
if ( ! error .empty() )
operationdetail .get_last_child() .add_child( OperationDetail( error, STATUS_NONE, FONT_ITALIC ) ) ;
return ( exit_status == 0 );
} }
bool fat16::create( const Partition & new_partition, OperationDetail & operationdetail ) bool fat16::create( const Partition & new_partition, OperationDetail & operationdetail )