From 048a012d21be2de5d836fead728c4d2deaf7f78e Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 26 Jan 2016 22:57:51 +0200 Subject: [PATCH] Utils: Minor cleanup in ShellCommandPage Change-Id: I4991caf2b96ccbcfe3ef763370c68678cd2e1424 Reviewed-by: Tobias Hunger --- src/libs/utils/shellcommandpage.cpp | 18 ++++++------------ src/libs/utils/shellcommandpage.h | 2 -- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/libs/utils/shellcommandpage.cpp b/src/libs/utils/shellcommandpage.cpp index ada3537f8c3..554fe5b1c36 100644 --- a/src/libs/utils/shellcommandpage.cpp +++ b/src/libs/utils/shellcommandpage.cpp @@ -87,8 +87,12 @@ void ShellCommandPage::start(ShellCommand *command) QTC_ASSERT(m_state != Running, return); m_command = command; command->setProgressiveOutput(true); - connect(command, &ShellCommand::stdOutText, this, &ShellCommandPage::reportStdOut); - connect(command, &ShellCommand::stdErrText, this, &ShellCommandPage::reportStdErr); + connect(command, &ShellCommand::stdOutText, this, [this](const QString &text) { + 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); QApplication::setOverrideCursor(Qt::WaitCursor); m_logPlainTextEdit->clear(); @@ -130,16 +134,6 @@ void ShellCommandPage::slotFinished(bool ok, int exitCode, const QVariant &) 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() { if (m_command) diff --git a/src/libs/utils/shellcommandpage.h b/src/libs/utils/shellcommandpage.h index ceb98d1821c..f716ab913b0 100644 --- a/src/libs/utils/shellcommandpage.h +++ b/src/libs/utils/shellcommandpage.h @@ -64,8 +64,6 @@ signals: private: void slotFinished(bool ok, int exitCode, const QVariant &cookie); - void reportStdOut(const QString &text); - void reportStdErr(const QString &text); QPlainTextEdit *m_logPlainTextEdit; OutputFormatter *m_formatter;