add verbose parameter

This commit is contained in:
Gerhard Hoffmann 2025-02-18 14:53:54 +01:00
parent dd0d7790e0
commit 7cdefc9b49

View File

@ -7,11 +7,12 @@
#include <QDateTime> #include <QDateTime>
Command::Command(QString command, QStringList args, QString workingDirectory, Command::Command(QString command, QStringList args, QString workingDirectory,
int start_timeout, int finish_timeout) bool verbose, int start_timeout, int finish_timeout)
: m_command(command.trimmed()) : m_command(command.trimmed())
, m_commandResult("") , m_commandResult("")
, m_waitForStartTimeout(start_timeout) , m_waitForStartTimeout(start_timeout)
, m_waitForFinishTimeout(finish_timeout) , m_waitForFinishTimeout(finish_timeout)
, m_verbose(verbose)
, m_exitCode(-1) , m_exitCode(-1)
, m_workingDirectory(workingDirectory) , m_workingDirectory(workingDirectory)
, m_args(args) { , m_args(args) {
@ -28,7 +29,10 @@ Command::Command(QString command, QStringList args, QString workingDirectory,
void Command::readyReadStandardOutput() { void Command::readyReadStandardOutput() {
QProcess *p = (QProcess *)sender(); QProcess *p = (QProcess *)sender();
if (p) { if (p) {
qCritical().noquote() << p->readAllStandardOutput(); QString s = p->readAllStandardOutput();
if (m_verbose) {
qCritical().noquote() << s;
}
} }
} }