[libcalamares] Small step in implementation

This commit is contained in:
Adriaan de Groot 2021-10-01 13:16:37 +02:00
parent e0fdde06c9
commit b9dac6eef8
2 changed files with 10 additions and 1 deletions

View File

@ -22,6 +22,7 @@ namespace Utils
struct Runner::Private
{
QStringList m_command;
RunLocation m_location = RunLocation::RunInHost;
};
Runner::Runner() {}
@ -33,6 +34,12 @@ Runner::Runner( const QStringList& command )
Runner::~Runner() {}
Runner&
Runner::setCommand( const QStringList& command )
{
d->m_command = command;
return *this;
}
} // namespace Utils
} // namespace Calamares

View File

@ -13,6 +13,7 @@
#include "CalamaresUtilsSystem.h"
#include <QDir>
#include <QObject>
#include <QStringList>
@ -27,6 +28,7 @@ namespace Utils
using RunLocation = CalamaresUtils::System::RunLocation;
/** @brief A Runner wraps a process and handles running it and signalling */
class Runner : public QObject
{
Q_OBJECT
@ -39,7 +41,7 @@ public:
Runner& setCommand( const QStringList& command );
Runner& setLocation( RunLocation r );
Runner& setWorkingDirectory( const QString& directory );
// TODO: maybe with QDir as well?
Runner& setWorkingDirectory( const QDir& directory );
Runner& setTimeout( std::chrono::seconds timeout );
Runner& setInput( const QString& stdin );