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:
parent
3eccd01f42
commit
a202b4569a
24
src/fat16.cc
24
src/fat16.cc
|
@ -195,17 +195,7 @@ bool fat16::write_label( const Partition & partition, OperationDetail & operatio
|
|||
else
|
||||
cmd = "mlabel ::\"" + pad_label( partition.get_filesystem_label() ) + "\" -i " + partition.get_path();
|
||||
|
||||
operationdetail .add_child( OperationDetail( cmd, STATUS_NONE, FONT_BOLD_ITALIC ) ) ;
|
||||
|
||||
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 );
|
||||
return ! execute_command( cmd, operationdetail, EXEC_CHECK_STATUS );
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
operationdetail .add_child( OperationDetail( cmd, STATUS_NONE, FONT_BOLD_ITALIC ) ) ;
|
||||
|
||||
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 );
|
||||
return ! execute_command( cmd, operationdetail, EXEC_CHECK_STATUS );
|
||||
}
|
||||
|
||||
bool fat16::create( const Partition & new_partition, OperationDetail & operationdetail )
|
||||
|
|
Loading…
Reference in New Issue