diff --git a/src/libcalamares/utils/CalamaresUtilsSystem.cpp b/src/libcalamares/utils/CalamaresUtilsSystem.cpp index 981132ae1..195d967f5 100644 --- a/src/libcalamares/utils/CalamaresUtilsSystem.cpp +++ b/src/libcalamares/utils/CalamaresUtilsSystem.cpp @@ -253,42 +253,44 @@ System::doChroot() const Calamares::JobResult ProcessResult::explainProcess( const QObject* parent, int ec, const QString& command, const QString& output, int timeout ) { +#define tr parent->tr using Calamares::JobResult; if ( ec == 0 ) return JobResult::ok(); QString outputMessage = output.isEmpty() ? QStringLiteral("\nThere was no output from the command.") - : (parent->tr("\nOutput:\n") + output); + : (tr("\nOutput:\n") + output); if ( ec == -1 ) //Crash! - return JobResult::error( parent->tr( "External command crashed." ), - parent->tr( "Command %1 crashed." ) + return JobResult::error( tr( "External command crashed." ), + tr( "Command %1 crashed." ) .arg( command ) + outputMessage ); if ( ec == -2 ) - return JobResult::error( parent->tr( "External command failed to start." ), - parent->tr( "Command %1 failed to start." ) + return JobResult::error( tr( "External command failed to start." ), + tr( "Command %1 failed to start." ) .arg( command ) ); if ( ec == -3 ) - return JobResult::error( parent->tr( "Internal error when starting command." ), - parent->tr( "Bad parameters for process job call." ) ); + return JobResult::error( tr( "Internal error when starting command." ), + tr( "Bad parameters for process job call." ) ); if ( ec == -4 ) - return JobResult::error( parent->tr( "External command failed to finish." ), - parent->tr( "Command %1 failed to finish in %2 seconds." ) + return JobResult::error( tr( "External command failed to finish." ), + tr( "Command %1 failed to finish in %2 seconds." ) .arg( command ) .arg( timeout ) + outputMessage ); //Any other exit code - return JobResult::error( parent->tr( "External command finished with errors." ), - parent->tr( "Command %1 finished with exit code %2." ) + return JobResult::error( tr( "External command finished with errors." ), + tr( "Command %1 finished with exit code %2." ) .arg( command ) .arg( ec ) + outputMessage ); +#undef tr } } // namespace