forked from qt-creator/qt-creator
ProjectExplorer: Split RunWorker::appendMessage overloads
... into separate functions. Makes the use of the parameter clearer and is easier to connect too. Change-Id: I061b0b5c847ae1e695afc75332e634ddf2576d6c Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -1379,7 +1379,7 @@ void SimpleTargetRunnerPrivate::handleStandardOutput()
|
||||
const QByteArray data = m_process.readAllStandardOutput();
|
||||
const QString msg = m_outputCodec->toUnicode(
|
||||
data.constData(), data.length(), &m_outputCodecState);
|
||||
q->appendMessage(msg, StdOutFormat, false);
|
||||
q->appendMessageChunk(msg, StdOutFormat);
|
||||
}
|
||||
|
||||
void SimpleTargetRunnerPrivate::handleStandardError()
|
||||
@@ -1387,7 +1387,7 @@ void SimpleTargetRunnerPrivate::handleStandardError()
|
||||
const QByteArray data = m_process.readAllStandardError();
|
||||
const QString msg = m_outputCodec->toUnicode(
|
||||
data.constData(), data.length(), &m_errorCodecState);
|
||||
q->appendMessage(msg, StdErrFormat, false);
|
||||
q->appendMessageChunk(msg, StdErrFormat);
|
||||
}
|
||||
|
||||
void SimpleTargetRunnerPrivate::start()
|
||||
@@ -1766,14 +1766,19 @@ void RunWorker::reportFailure(const QString &msg)
|
||||
* Appends a message in the specified \a format to
|
||||
* the owning RunControl's \uicontrol{Application Output} pane.
|
||||
*/
|
||||
void RunWorker::appendMessage(const QString &msg, OutputFormat format, bool appendNewLine)
|
||||
void RunWorker::appendMessage(const QString &msg, OutputFormat format)
|
||||
{
|
||||
if (!appendNewLine || msg.endsWith('\n'))
|
||||
if (msg.endsWith('\n'))
|
||||
emit d->runControl->appendMessage(msg, format);
|
||||
else
|
||||
emit d->runControl->appendMessage(msg + '\n', format);
|
||||
}
|
||||
|
||||
void RunWorker::appendMessageChunk(const QString &msg, OutputFormat format)
|
||||
{
|
||||
emit d->runControl->appendMessage(msg, format);
|
||||
}
|
||||
|
||||
IDevice::ConstPtr RunWorker::device() const
|
||||
{
|
||||
return d->runControl->device();
|
||||
|
@@ -92,7 +92,8 @@ public:
|
||||
QVariant recordedData(const QString &channel) const;
|
||||
|
||||
// Part of read-only interface of RunControl for convenience.
|
||||
void appendMessage(const QString &msg, Utils::OutputFormat format, bool appendNewLine = true);
|
||||
void appendMessage(const QString &msg, Utils::OutputFormat format);
|
||||
void appendMessageChunk(const QString &msg, Utils::OutputFormat format);
|
||||
IDeviceConstPtr device() const;
|
||||
|
||||
// States
|
||||
|
Reference in New Issue
Block a user