Utils: Minor cleanup in ShellCommandPage

Change-Id: I4991caf2b96ccbcfe3ef763370c68678cd2e1424
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2016-01-26 22:57:51 +02:00
committed by Orgad Shaneh
parent 9ff5786d53
commit 048a012d21
2 changed files with 6 additions and 14 deletions

View File

@@ -87,8 +87,12 @@ void ShellCommandPage::start(ShellCommand *command)
QTC_ASSERT(m_state != Running, return); QTC_ASSERT(m_state != Running, return);
m_command = command; m_command = command;
command->setProgressiveOutput(true); command->setProgressiveOutput(true);
connect(command, &ShellCommand::stdOutText, this, &ShellCommandPage::reportStdOut); connect(command, &ShellCommand::stdOutText, this, [this](const QString &text) {
connect(command, &ShellCommand::stdErrText, this, &ShellCommandPage::reportStdErr); m_formatter->appendMessage(text, Utils::StdOutFormat);
});
connect(command, &ShellCommand::stdErrText, this, [this](const QString &text) {
m_formatter->appendMessage(text, Utils::StdErrFormat);
});
connect(command, &ShellCommand::finished, this, &ShellCommandPage::slotFinished); connect(command, &ShellCommand::finished, this, &ShellCommandPage::slotFinished);
QApplication::setOverrideCursor(Qt::WaitCursor); QApplication::setOverrideCursor(Qt::WaitCursor);
m_logPlainTextEdit->clear(); m_logPlainTextEdit->clear();
@@ -130,16 +134,6 @@ void ShellCommandPage::slotFinished(bool ok, int exitCode, const QVariant &)
emit finished(success); emit finished(success);
} }
void ShellCommandPage::reportStdOut(const QString &text)
{
m_formatter->appendMessage(text, Utils::StdOutFormat);
}
void ShellCommandPage::reportStdErr(const QString &text)
{
m_formatter->appendMessage(text, Utils::StdErrFormat);
}
void ShellCommandPage::terminate() void ShellCommandPage::terminate()
{ {
if (m_command) if (m_command)

View File

@@ -64,8 +64,6 @@ signals:
private: private:
void slotFinished(bool ok, int exitCode, const QVariant &cookie); void slotFinished(bool ok, int exitCode, const QVariant &cookie);
void reportStdOut(const QString &text);
void reportStdErr(const QString &text);
QPlainTextEdit *m_logPlainTextEdit; QPlainTextEdit *m_logPlainTextEdit;
OutputFormatter *m_formatter; OutputFormatter *m_formatter;