QtPass 1.4.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
Classes | Signals | Public Member Functions | Static 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
 
void starting ()
 starting signal that is emited when process starts
 
void error (int id, int exitCode, const QString &output, const QString &errout)
 error signal that is emited when process finishes with an error
 

Public Member Functions

 Executor (QObject *parent=0)
 Executor::Executor executes external applications.
 
void execute (int id, const QString &app, const QStringList &args, bool readStdout, bool readStderr=true)
 Executor::execute execute an app.
 
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.
 
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.
 
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.
 
void setEnvironment (const QStringList &env)
 Executor::setEnvironment set environment variables for executor processes.
 
int cancelNext ()
 Executor::cancelNext cancels execution of first process in queue if it's not already running.
 

Static Public Member Functions

static 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.
 
static int executeBlocking (QString app, const QStringList &args, QString *process_out, QString *process_err=Q_NULLPTR)
 Executor::executeBlocking blocking version of the executor.
 

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 19 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 233 of file executor.cpp.

+ Here is the caller graph for this function:

◆ 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 68 of file executor.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ execute() [2/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 97 of file executor.cpp.

+ Here is the call graph for this function:

◆ execute() [3/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 82 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 113 of file executor.cpp.

◆ executeBlocking() [1/2]

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

Executor::executeBlocking blocking version of the executor.

Parameters
app
args
process_out
process_err
Returns

Definition at line 213 of file executor.cpp.

+ Here is the call graph for this function:

◆ executeBlocking() [2/2]

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

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 171 of file executor.cpp.

+ Here is the caller 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 223 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: