[shellprocess] Apply current coding style

This commit is contained in:
Adriaan de Groot 2019-08-01 23:10:20 +02:00
parent d363732302
commit a0430f76b7
3 changed files with 57 additions and 54 deletions

View file

@ -18,13 +18,13 @@
#include "ShellProcessJob.h"
#include <QProcess>
#include <QDateTime>
#include <QProcess>
#include <QThread>
#include "CalamaresVersion.h"
#include "JobQueue.h"
#include "GlobalStorage.h"
#include "JobQueue.h"
#include "utils/CommandList.h"
#include "utils/Logger.h"
@ -55,7 +55,7 @@ Calamares::JobResult
ShellProcessJob::exec()
{
if ( ! m_commands || m_commands->isEmpty() )
if ( !m_commands || m_commands->isEmpty() )
{
cWarning() << "No commands to execute" << moduleInstanceKey();
return Calamares::JobResult::ok();
@ -71,16 +71,23 @@ ShellProcessJob::setConfigurationMap( const QVariantMap& configurationMap )
bool dontChroot = CalamaresUtils::getBool( configurationMap, "dontChroot", false );
int timeout = CalamaresUtils::getInteger( configurationMap, "timeout", 10 );
if ( timeout < 1 )
{
timeout = 10;
}
if ( configurationMap.contains( "script" ) )
{
m_commands = new CalamaresUtils::CommandList( configurationMap.value( "script" ), !dontChroot, std::chrono::seconds( timeout ) );
m_commands = new CalamaresUtils::CommandList(
configurationMap.value( "script" ), !dontChroot, std::chrono::seconds( timeout ) );
if ( m_commands->isEmpty() )
{
cDebug() << "ShellProcessJob: \"script\" contains no commands for" << moduleInstanceKey();
}
}
else
{
cWarning() << "No script given for ShellProcessJob" << moduleInstanceKey();
}
}
CALAMARES_PLUGIN_FACTORY_DEFINITION( ShellProcessJobFactory, registerPlugin<ShellProcessJob>(); )
CALAMARES_PLUGIN_FACTORY_DEFINITION( ShellProcessJobFactory, registerPlugin< ShellProcessJob >(); )