QtPass  1.2.0
Multi-platform GUI for pass, the standard unix password manager.
Classes | Signals | Public Member Functions | List of all members
Executor Class Reference

Executes external commands for handleing password, git and other data. More...

#include <executor.h>

+ Inheritance diagram for Executor:
+ Collaboration diagram for Executor:

Signals

void finished (int id, int exitCode, const QString &output, const QString &errout)
 finished signal that is emited when process finishes More...
 
void starting ()
 starting signal that is emited when process starts More...
 
void error (int id, int exitCode, const QString &output, const QString &errout)
 error signal that is emited when process finishes with an error More...
 

Public Member Functions

 Executor (QObject *parent=0)
 Executor::Executor executes external applications. More...
 
void execute (int id, const QString &app, const QStringList &args, bool readStdout, bool readStderr=true)
 Executor::execute execute an app. More...
 
void execute (int id, const QString &workDir, const QString &app, const QStringList &args, bool readStdout, bool readStderr=true)
 Executor::execute executes an app from a workDir. More...
 
void execute (int id, const QString &app, const QStringList &args, QString input=QString(), bool readStdout=false, bool readStderr=true)
 Executor::execute an app, takes input and presents it as stdin. More...
 
void execute (int id, const QString &workDir, const QString &app, const QStringList &args, QString input=QString(), bool readStdout=false, bool readStderr=true)
 Executor::execute executes an app from a workDir, takes input and presents it as stdin. More...
 
int executeBlocking (QString app, const QStringList &args, QString input=QString(), QString *process_out=Q_NULLPTR, QString *process_err=Q_NULLPTR)
 Executor::executeBlocking blocking version of the executor, takes input and presents it as stdin. More...
 
int executeBlocking (QString app, const QStringList &args, QString *process_out, QString *process_err=Q_NULLPTR)
 Executor::executeBlocking blocking version of the executor. More...
 
void setEnvironment (const QStringList &env)
 Executor::setEnvironment set environment variables for executor processes. More...
 
int cancelNext ()
 Executor::cancelNext cancels execution of first process in queue if it's not already running. More...
 

Detailed Description

Executes external commands for handleing password, git and other data.

Definition at line 12 of file executor.h.

Constructor & Destructor Documentation

◆ Executor()

Executor::Executor ( QObject *  parent = 0)
explicit

Executor::Executor executes external applications.

Parameters
parent

Definition at line 11 of file executor.cpp.

Member Function Documentation

◆ cancelNext()

int Executor::cancelNext ( )

Executor::cancelNext cancels execution of first process in queue if it's not already running.

Returns
id of the cancelled process or -1 on error

Definition at line 181 of file executor.cpp.

◆ error

void Executor::error ( int  id,
int  exitCode,
const QString &  output,
const QString &  errout 
)
signal

error signal that is emited when process finishes with an error

Parameters
idid of the process
exitCodereturn code of the process
outputstdout produced by the process
erroutstderr produced by the process

◆ execute() [1/4]

void Executor::execute ( int  id,
const QString &  app,
const QStringList &  args,
bool  readStdout,
bool  readStderr = true 
)

Executor::execute execute an app.

Parameters
id
app
args
readStdout
readStderr

Definition at line 50 of file executor.cpp.

+ Here is the caller graph for this function:

◆ execute() [2/4]

void Executor::execute ( int  id,
const QString &  workDir,
const QString &  app,
const QStringList &  args,
bool  readStdout,
bool  readStderr = true 
)

Executor::execute executes an app from a workDir.

Parameters
id
workDir
app
args
readStdout
readStderr

Definition at line 64 of file executor.cpp.

+ Here is the call graph for this function:

◆ execute() [3/4]

void Executor::execute ( int  id,
const QString &  app,
const QStringList &  args,
QString  input = QString(),
bool  readStdout = false,
bool  readStderr = true 
)

Executor::execute an app, takes input and presents it as stdin.

Parameters
id
app
args
input
readStdout
readStderr

Definition at line 79 of file executor.cpp.

+ Here is the call graph for this function:

◆ execute() [4/4]

void Executor::execute ( int  id,
const QString &  workDir,
const QString &  app,
const QStringList &  args,
QString  input = QString(),
bool  readStdout = false,
bool  readStderr = true 
)

Executor::execute executes an app from a workDir, takes input and presents it as stdin.

Parameters
id
workDir
app
args
input
readStdout
readStderr

Definition at line 95 of file executor.cpp.

◆ executeBlocking() [1/2]

int Executor::executeBlocking ( QString  app,
const QStringList &  args,
QString  input = QString(),
QString *  process_out = Q_NULLPTR,
QString *  process_err = Q_NULLPTR 
)

Executor::executeBlocking blocking version of the executor, takes input and presents it as stdin.

Parameters
app
args
input
process_out
process_err
Returns

TODO(bezet): it might make sense to throw here, a lot of possible errors

Definition at line 124 of file executor.cpp.

+ Here is the caller graph for this function:

◆ executeBlocking() [2/2]

int Executor::executeBlocking ( QString  app,
const QStringList &  args,
QString *  process_out,
QString *  process_err = Q_NULLPTR 
)

Executor::executeBlocking blocking version of the executor.

Parameters
app
args
process_out
process_err
Returns

Definition at line 161 of file executor.cpp.

+ Here is the call graph for this function:

◆ finished

void Executor::finished ( int  id,
int  exitCode,
const QString &  output,
const QString &  errout 
)
signal

finished signal that is emited when process finishes

Parameters
idid of the process
exitCodereturn code of the process
outputstdout produced by the process
erroutstderr produced by the process

◆ setEnvironment()

void Executor::setEnvironment ( const QStringList &  env)

Executor::setEnvironment set environment variables for executor processes.

Parameters
env

Definition at line 171 of file executor.cpp.

+ Here is the caller graph for this function:

◆ starting

void Executor::starting ( )
signal

starting signal that is emited when process starts

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: