forked from qt-creator/qt-creator
Use QtcProcess for clangbackend
Change-Id: Ifdcdba765409a09861f81dd3dff405115a986801 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -36,6 +36,8 @@
|
||||
#include <QProcess>
|
||||
#include <QThread>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace ClangBackEnd {
|
||||
|
||||
ConnectionClient::ConnectionClient(const QString &connectionName)
|
||||
@@ -159,7 +161,7 @@ void ConnectionClient::restartProcessIfTimerIsNotResettedAndSocketIsEmpty()
|
||||
restartProcessAsynchronously();
|
||||
}
|
||||
|
||||
void ConnectionClient::endProcess(QProcess *process)
|
||||
void ConnectionClient::endProcess(QtcProcess *process)
|
||||
{
|
||||
if (isProcessRunning(process) && isConnected()) {
|
||||
sendEndMessage();
|
||||
@@ -167,15 +169,15 @@ void ConnectionClient::endProcess(QProcess *process)
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectionClient::terminateProcess(QProcess *process)
|
||||
void ConnectionClient::terminateProcess(QtcProcess *process)
|
||||
{
|
||||
if (!Utils::HostOsInfo::isWindowsHost() && isProcessRunning()) {
|
||||
if (!HostOsInfo::isWindowsHost() && isProcessRunning()) {
|
||||
process->terminate();
|
||||
process->waitForFinished(1000);
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectionClient::killProcess(QProcess *process)
|
||||
void ConnectionClient::killProcess(QtcProcess *process)
|
||||
{
|
||||
if (isProcessRunning(process)) {
|
||||
process->kill();
|
||||
@@ -213,7 +215,7 @@ void ConnectionClient::resetTemporaryDirectory()
|
||||
m_processCreator.resetTemporaryDirectory();
|
||||
}
|
||||
|
||||
void ConnectionClient::initializeProcess(QProcess *process)
|
||||
void ConnectionClient::initializeProcess(QtcProcess *process)
|
||||
{
|
||||
connectStandardOutputAndError(process);
|
||||
|
||||
@@ -299,7 +301,7 @@ bool ConnectionClient::waitForConnected()
|
||||
}
|
||||
|
||||
|
||||
QProcess *ConnectionClient::processForTestOnly()
|
||||
QtcProcess *ConnectionClient::processForTestOnly()
|
||||
{
|
||||
getProcessFromFuture();
|
||||
|
||||
@@ -311,15 +313,15 @@ QIODevice *ConnectionClient::ioDevice()
|
||||
return m_localSocket;
|
||||
}
|
||||
|
||||
bool ConnectionClient::isProcessRunning(QProcess *process)
|
||||
bool ConnectionClient::isProcessRunning(QtcProcess *process)
|
||||
{
|
||||
return process && process->state() == QProcess::Running;
|
||||
}
|
||||
|
||||
void ConnectionClient::connectStandardOutputAndError(QProcess *process) const
|
||||
void ConnectionClient::connectStandardOutputAndError(QtcProcess *process) const
|
||||
{
|
||||
connect(process, &QProcess::readyReadStandardOutput, this, &ConnectionClient::printStandardOutput);
|
||||
connect(process, &QProcess::readyReadStandardError, this, &ConnectionClient::printStandardError);
|
||||
connect(process, &QtcProcess::readyReadStandardOutput, this, &ConnectionClient::printStandardOutput);
|
||||
connect(process, &QtcProcess::readyReadStandardError, this, &ConnectionClient::printStandardError);
|
||||
}
|
||||
|
||||
void ConnectionClient::connectLocalSocketError() const
|
||||
|
||||
Reference in New Issue
Block a user