forked from qt-creator/qt-creator
Utils: Minor cleanup in ShellCommandPage
Change-Id: I4991caf2b96ccbcfe3ef763370c68678cd2e1424 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
9ff5786d53
commit
048a012d21
@@ -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)
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user