[partition] Add non-const lvalue overload for execute()

This commit is contained in:
Adriaan de Groot 2021-12-11 23:19:01 +01:00
parent b8ce21d572
commit c5573a1997
2 changed files with 12 additions and 2 deletions

View File

@ -128,7 +128,7 @@ clonePartition( Device* device, Partition* partition )
}
Calamares::JobResult
execute( Operation&& operation, const QString& failureMessage )
execute( Operation& operation, const QString& failureMessage )
{
operation.setStatus( Operation::StatusRunning );

View File

@ -80,7 +80,17 @@ Partition* clonePartition( Device* device, Partition* partition );
* Otherwise returns an error using @p failureMessage as the primary part
* of the error, and details obtained from the operation.
*/
Calamares::JobResult execute( Operation&& operation, const QString& failureMessage );
Calamares::JobResult execute( Operation& operation, const QString& failureMessage );
/** @brief Return a result for an @p operation
*
* It's acceptable to use an rvalue: the operation-running is the effect
* you're interested in, rather than keeping the temporary around.
*/
static inline Calamares::JobResult
execute( Operation&& operation, const QString& failureMessage )
{
return execute( operation, failureMessage );
}
} // namespace KPMHelpers