mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-07 23:24:28 -04:00
[libcalamares] Small step in implementation
This commit is contained in:
parent
e0fdde06c9
commit
b9dac6eef8
2 changed files with 10 additions and 1 deletions
|
@ -22,6 +22,7 @@ namespace Utils
|
||||||
struct Runner::Private
|
struct Runner::Private
|
||||||
{
|
{
|
||||||
QStringList m_command;
|
QStringList m_command;
|
||||||
|
RunLocation m_location = RunLocation::RunInHost;
|
||||||
};
|
};
|
||||||
|
|
||||||
Runner::Runner() {}
|
Runner::Runner() {}
|
||||||
|
@ -33,6 +34,12 @@ Runner::Runner( const QStringList& command )
|
||||||
|
|
||||||
Runner::~Runner() {}
|
Runner::~Runner() {}
|
||||||
|
|
||||||
|
Runner&
|
||||||
|
Runner::setCommand( const QStringList& command )
|
||||||
|
{
|
||||||
|
d->m_command = command;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Utils
|
} // namespace Utils
|
||||||
} // namespace Calamares
|
} // namespace Calamares
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include "CalamaresUtilsSystem.h"
|
#include "CalamaresUtilsSystem.h"
|
||||||
|
|
||||||
|
#include <QDir>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
|
@ -27,6 +28,7 @@ namespace Utils
|
||||||
|
|
||||||
using RunLocation = CalamaresUtils::System::RunLocation;
|
using RunLocation = CalamaresUtils::System::RunLocation;
|
||||||
|
|
||||||
|
/** @brief A Runner wraps a process and handles running it and signalling */
|
||||||
class Runner : public QObject
|
class Runner : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -39,7 +41,7 @@ public:
|
||||||
Runner& setCommand( const QStringList& command );
|
Runner& setCommand( const QStringList& command );
|
||||||
Runner& setLocation( RunLocation r );
|
Runner& setLocation( RunLocation r );
|
||||||
Runner& setWorkingDirectory( const QString& directory );
|
Runner& setWorkingDirectory( const QString& directory );
|
||||||
// TODO: maybe with QDir as well?
|
Runner& setWorkingDirectory( const QDir& directory );
|
||||||
Runner& setTimeout( std::chrono::seconds timeout );
|
Runner& setTimeout( std::chrono::seconds timeout );
|
||||||
Runner& setInput( const QString& stdin );
|
Runner& setInput( const QString& stdin );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue