From 7cdefc9b49a698d0d1ffde36cf02d98b71ff8a6e Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Tue, 18 Feb 2025 14:53:54 +0100 Subject: [PATCH] add verbose parameter --- common/src/command.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/src/command.cpp b/common/src/command.cpp index eae49e6..98af254 100644 --- a/common/src/command.cpp +++ b/common/src/command.cpp @@ -7,11 +7,12 @@ #include 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_commandResult("") , m_waitForStartTimeout(start_timeout) , m_waitForFinishTimeout(finish_timeout) + , m_verbose(verbose) , m_exitCode(-1) , m_workingDirectory(workingDirectory) , m_args(args) { @@ -28,7 +29,10 @@ Command::Command(QString command, QStringList args, QString workingDirectory, void Command::readyReadStandardOutput() { QProcess *p = (QProcess *)sender(); if (p) { - qCritical().noquote() << p->readAllStandardOutput(); + QString s = p->readAllStandardOutput(); + if (m_verbose) { + qCritical().noquote() << s; + } } }