[dummycpp] Replace QProcess::execute()

- hangs unpredictably during testing
 - replace with the Calamares process-invocation runCommand(), which is also
   synchronous but doesn't hang (or, hasn't, in testing so far)
This commit is contained in:
Adriaan de Groot 2019-08-27 13:34:26 +02:00
parent c28c97d3aa
commit e0bb53aff4

View File

@ -28,6 +28,7 @@
#include "GlobalStorage.h" #include "GlobalStorage.h"
#include "JobQueue.h" #include "JobQueue.h"
#include "utils/CalamaresUtilsSystem.h"
#include "utils/Logger.h" #include "utils/Logger.h"
DummyCppJob::DummyCppJob( QObject* parent ) DummyCppJob::DummyCppJob( QObject* parent )
@ -113,8 +114,9 @@ Calamares::JobResult
DummyCppJob::exec() DummyCppJob::exec()
{ {
// Ported from dummypython // Ported from dummypython
QProcess::execute( "/bin/sh", CalamaresUtils::System::runCommand( CalamaresUtils::System::RunLocation::RunInHost,
QStringList() << "-c" QStringList() << "/bin/sh"
<< "-c"
<< "touch ~/calamares-dummycpp" ); << "touch ~/calamares-dummycpp" );
QString accumulator = QDateTime::currentDateTimeUtc().toString( Qt::ISODate ) + '\n'; QString accumulator = QDateTime::currentDateTimeUtc().toString( Qt::ISODate ) + '\n';
accumulator += QStringLiteral( "Calamares version: " ) + CALAMARES_VERSION_SHORT + '\n'; accumulator += QStringLiteral( "Calamares version: " ) + CALAMARES_VERSION_SHORT + '\n';