diff --git a/src/plugins/projectexplorer/applicationlauncher.cpp b/src/plugins/projectexplorer/applicationlauncher.cpp index 50cdea972b1..1dcb2092508 100644 --- a/src/plugins/projectexplorer/applicationlauncher.cpp +++ b/src/plugins/projectexplorer/applicationlauncher.cpp @@ -459,13 +459,15 @@ void ApplicationLauncherPrivate::handleApplicationFinished() void ApplicationLauncherPrivate::handleRemoteStdout() { QTC_ASSERT(m_state == Run, return); - emit q->remoteStdout(m_deviceProcess->readAllStandardOutput()); + const QByteArray output = m_deviceProcess->readAllStandardOutput(); + emit q->remoteStdout(QString::fromUtf8(output)); } void ApplicationLauncherPrivate::handleRemoteStderr() { QTC_ASSERT(m_state == Run, return); - emit q->remoteStderr(m_deviceProcess->readAllStandardError()); + const QByteArray output = m_deviceProcess->readAllStandardError(); + emit q->remoteStderr(QString::fromUtf8(output)); } void ApplicationLauncherPrivate::doReportError(const QString &message) diff --git a/src/plugins/projectexplorer/applicationlauncher.h b/src/plugins/projectexplorer/applicationlauncher.h index 9e4ce57ebb8..a8570dbbaab 100644 --- a/src/plugins/projectexplorer/applicationlauncher.h +++ b/src/plugins/projectexplorer/applicationlauncher.h @@ -74,8 +74,8 @@ signals: void processExited(int exitCode, QProcess::ExitStatus); void error(QProcess::ProcessError error); - void remoteStdout(const QByteArray &output); - void remoteStderr(const QByteArray &output); + void remoteStdout(const QString &output); + void remoteStderr(const QString &output); void reportProgress(const QString &progressOutput); void reportError(const QString &errorOutput); void remoteProcessStarted(); diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 7d7c1926704..d0984117068 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -1309,13 +1309,13 @@ void SimpleTargetRunner::start() }); connect(&m_launcher, &ApplicationLauncher::remoteStderr, - this, [this](const QByteArray &output) { - appendMessage(QString::fromUtf8(output), Utils::StdErrFormatSameLine); + this, [this](const QString &output) { + appendMessage(output, Utils::StdErrFormatSameLine); }); connect(&m_launcher, &ApplicationLauncher::remoteStdout, - this, [this](const QByteArray &output) { - appendMessage(QString::fromUtf8(output), Utils::StdOutFormatSameLine); + this, [this](const QString &output) { + appendMessage(output, Utils::StdOutFormatSameLine); }); connect(&m_launcher, &ApplicationLauncher::finished, diff --git a/src/plugins/qnx/qnxattachdebugsupport.cpp b/src/plugins/qnx/qnxattachdebugsupport.cpp index 16ef27610df..43714da762c 100644 --- a/src/plugins/qnx/qnxattachdebugsupport.cpp +++ b/src/plugins/qnx/qnxattachdebugsupport.cpp @@ -156,10 +156,10 @@ void QnxAttachDebugSupport::handleProgressReport(const QString &message) m_runTool->showMessage(message + QLatin1Char('\n'), Debugger::AppStuff); } -void QnxAttachDebugSupport::handleRemoteOutput(const QByteArray &output) +void QnxAttachDebugSupport::handleRemoteOutput(const QString &output) { if (m_runTool) - m_runTool->showMessage(QString::fromUtf8(output), Debugger::AppOutput); + m_runTool->showMessage(output, Debugger::AppOutput); } void QnxAttachDebugSupport::stopPDebug() diff --git a/src/plugins/qnx/qnxattachdebugsupport.h b/src/plugins/qnx/qnxattachdebugsupport.h index 8d970e82483..1bb00a42f46 100644 --- a/src/plugins/qnx/qnxattachdebugsupport.h +++ b/src/plugins/qnx/qnxattachdebugsupport.h @@ -59,7 +59,7 @@ private slots: void handleDebuggerStateChanged(Debugger::DebuggerState state); void handleError(const QString &message); void handleProgressReport(const QString &message); - void handleRemoteOutput(const QByteArray &output); + void handleRemoteOutput(const QString &output); private: void stopPDebug(); diff --git a/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp b/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp index d3131db2f7b..48aac088138 100644 --- a/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp @@ -62,27 +62,27 @@ void FifoGatherer::start() r.workingDirectory = QLatin1String("/tmp"); r.runMode = ApplicationLauncher::Console; - QSharedPointer output(new QByteArray); - QSharedPointer errors(new QByteArray); + QSharedPointer output(new QString); + QSharedPointer errors(new QString); connect(&m_fifoCreator, &ApplicationLauncher::finished, this, [this, output, errors](bool success) { if (!success) { - reportFailure(QString("Failed to create fifo: %1").arg(QLatin1String(*errors))); + reportFailure(QString("Failed to create fifo: %1").arg(*errors)); } else { - m_fifo = QString::fromLatin1(*output); + m_fifo = *output; appendMessage(tr("Created fifo: %1").arg(m_fifo), NormalMessageFormat); reportStarted(); } }); connect(&m_fifoCreator, &ApplicationLauncher::remoteStdout, - this, [output](const QByteArray &data) { + this, [output](const QString &data) { output->append(data); }); connect(&m_fifoCreator, &ApplicationLauncher::remoteStderr, - this, [this, errors](const QByteArray &) { + this, [this, errors](const QString &) { reportFailure(); // errors->append(data); }); diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index dec6098c688..2594f33e95b 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -48,13 +48,13 @@ public: void run(); - void handleRemoteStderr(const QByteArray &b); - void handleRemoteStdout(const QByteArray &b); + void handleRemoteStderr(const QString &b); + void handleRemoteStdout(const QString &b); void closed(bool success); void localProcessStarted(); void remoteProcessStarted(); - void findPIDOutputReceived(const QByteArray &out); + void findPidOutputReceived(const QString &out); ValgrindRunner *q; StandardRunnable m_debuggee; @@ -121,16 +121,16 @@ void ValgrindRunner::Private::run() m_valgrindProcess.start(valgrind, m_device); } -void ValgrindRunner::Private::handleRemoteStderr(const QByteArray &b) +void ValgrindRunner::Private::handleRemoteStderr(const QString &b) { if (!b.isEmpty()) - q->processOutputReceived(QString::fromUtf8(b), Utils::StdErrFormat); + q->processOutputReceived(b, Utils::StdErrFormat); } -void ValgrindRunner::Private::handleRemoteStdout(const QByteArray &b) +void ValgrindRunner::Private::handleRemoteStdout(const QString &b) { if (!b.isEmpty()) - q->processOutputReceived(QString::fromUtf8(b), Utils::StdOutFormat); + q->processOutputReceived(b, Utils::StdOutFormat); } void ValgrindRunner::Private::localProcessStarted() @@ -169,11 +169,11 @@ void ValgrindRunner::Private::remoteProcessStarted() connect(&m_findPID, &ApplicationLauncher::remoteStderr, this, &ValgrindRunner::Private::handleRemoteStderr); connect(&m_findPID, &ApplicationLauncher::remoteStdout, - this, &ValgrindRunner::Private::findPIDOutputReceived); + this, &ValgrindRunner::Private::findPidOutputReceived); m_findPID.start(findPid, m_device); } -void ValgrindRunner::Private::findPIDOutputReceived(const QByteArray &out) +void ValgrindRunner::Private::findPidOutputReceived(const QString &out) { if (out.isEmpty()) return;