|
QtPass 1.6.0
Multi-platform GUI for pass, the standard unix password manager.
|
id Identifier provided by the caller for this queued request. More...
#include <executor.h>
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=nullptr) | |
| 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. | |
| auto | cancelNext () -> int |
| Executor::cancelNext cancels execution of first process in queue if it's not already running. | |
Static Public Member Functions | |
| static auto | executeBlocking (QString app, const QStringList &args, const QString &input=QString(), QString *process_out=nullptr, QString *process_err=nullptr) -> int |
| Executor::executeBlocking blocking version of the executor, takes input and presents it as stdin. | |
| static auto | executeBlocking (QString app, const QStringList &args, QString *process_out, QString *process_err=nullptr) -> int |
| Executor::executeBlocking blocking version of the executor. | |
| static auto | executeBlocking (const QStringList &env, QString app, const QStringList &args, QString *process_out=nullptr, QString *process_err=nullptr) -> int |
| Executor::executeBlocking blocking version with custom environment. | |
id Identifier provided by the caller for this queued request.
Executor executes external commands used for password, git, and other non-interactive operations.
Uses a single QProcess and an internal FIFO queue to run requested commands in order and emit completion or error signals for each request. Execution queue item representing a single non-interactive process request.
Contains the command, its arguments, optional stdin content, capture flags, and an optional working directory.
app Path to the executable to run.
args Arguments to pass to the executable.
input Data to write to the process's stdin.
readStdout When true, capture the process's stdout for the result.
readStderr When true, capture the process's stderr for the result. Note: stderr is captured regardless of this flag when the process exits with a non-zero exit code.
workingDir Working directory in which the process will be started.
finished Emitted when a queued process completes.
| id | Identifier of the completed request. |
| exitCode | Process exit code. |
| output | Captured stdout produced by the process (may be empty). |
| errout | Captured stderr produced by the process (may be empty). |
starting Emitted when the executor begins running a queued process.
error Emitted when a queued process finishes with an error condition.
| id | Identifier of the failed request. |
| exitCode | Process exit code. |
| output | Captured stdout produced by the process (may be empty). |
| errout | Captured stderr produced by the process (may be empty). |
Definition at line 76 of file executor.h.
|
explicit |
Executor::Executor executes external applications.
| parent |
Definition at line 22 of file executor.cpp.
| auto Executor::cancelNext | ( | ) | -> int |
Executor::cancelNext cancels execution of first process in queue if it's not already running.
Definition at line 331 of file executor.cpp.
|
signal |
error signal that is emited when process finishes with an error
| id | id of the process |
| exitCode | return code of the process |
| output | stdout produced by the process |
| errout | stderr produced by the process |
| void Executor::execute | ( | int | id, |
| const QString & | app, | ||
| const QStringList & | args, | ||
| bool | readStdout, | ||
| bool | readStderr = true ) |
Executor::execute execute an app.
| id | |
| app | |
| args | |
| readStdout | |
| readStderr |
Definition at line 111 of file executor.cpp.
| 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.
| id | |
| app | |
| args | |
| input | |
| readStdout | |
| readStderr |
Definition at line 140 of file executor.cpp.
| 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.
| id | |
| workDir | |
| app | |
| args | |
| readStdout | |
| readStderr |
Definition at line 125 of file executor.cpp.
| 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.
| id | |
| workDir | |
| app | |
| args | |
| input | |
| readStdout | |
| readStderr |
Definition at line 156 of file executor.cpp.
|
static |
Executor::executeBlocking blocking version with custom environment.
| env | Environment variables to set |
| app | Executable path |
| args | Arguments |
| process_out | Standard output |
| process_err | Standard error |
Definition at line 284 of file executor.cpp.
|
static |
Executor::executeBlocking blocking version of the executor, takes input and presents it as stdin.
| app | |
| args | |
| input | |
| process_out | |
| process_err |
Note: Returning error code instead of throwing to maintain compatibility with the existing error handling pattern used throughout QtPass.
Definition at line 223 of file executor.cpp.
|
static |
Executor::executeBlocking blocking version of the executor.
| app | |
| args | |
| process_out | |
| process_err |
Definition at line 268 of file executor.cpp.
|
signal |
finished signal that is emited when process finishes
| id | id of the process |
| exitCode | return code of the process |
| output | stdout produced by the process |
| errout | stderr produced by the process |
| void Executor::setEnvironment | ( | const QStringList & | env | ) |
Executor::setEnvironment set environment variables for executor processes.
| env |
Definition at line 321 of file executor.cpp.
|
signal |
starting signal that is emited when process starts