forked from qt-creator/qt-creator
QtcProcess: Limit the inclusion of qtcprocess.h
Move the rest of QtcProcess enums to processenums.h. Move ExitCodeInterpreter into processenums.h. Remove superfluous Utils:: prefix. Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -60,14 +60,14 @@ static QString finishedWithBadExitCode(const QString &name, int exitCode)
|
||||
}
|
||||
|
||||
ClangToolRunner::ClangToolRunner(QObject *parent)
|
||||
: QObject(parent), m_process(new Utils::QtcProcess)
|
||||
: QObject(parent), m_process(new QtcProcess)
|
||||
{}
|
||||
|
||||
ClangToolRunner::~ClangToolRunner()
|
||||
{
|
||||
if (m_process->state() != QProcess::NotRunning) {
|
||||
// asking politly to terminate costs ~300 ms on windows so skip the courtasy and direct kill the process
|
||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
m_process->kill();
|
||||
m_process->waitForFinished(100);
|
||||
} else {
|
||||
@@ -147,10 +147,10 @@ bool ClangToolRunner::run(const QString &fileToAnalyze, const QStringList &compi
|
||||
|
||||
void ClangToolRunner::onProcessFinished()
|
||||
{
|
||||
if (m_process->result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (m_process->result() == ProcessResult::FinishedWithSuccess) {
|
||||
qCDebug(LOG).noquote() << "Output:\n" << m_process->stdOut();
|
||||
emit finishedWithSuccess(m_fileToAnalyze);
|
||||
} else if (m_process->result() == QtcProcess::FinishedWithError) {
|
||||
} else if (m_process->result() == ProcessResult::FinishedWithError) {
|
||||
emit finishedWithFailure(finishedWithBadExitCode(m_name, m_process->exitCode()),
|
||||
commandlineAndOutput());
|
||||
} else { // == QProcess::CrashExit
|
||||
|
||||
@@ -27,10 +27,14 @@
|
||||
|
||||
#include "clangtoolslogfilereader.h"
|
||||
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/commandline.h>
|
||||
|
||||
#include <QProcess>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
|
||||
|
||||
@@ -55,9 +55,9 @@ static QString runExecutable(const Utils::CommandLine &commandLine, QueryFailMod
|
||||
cpp.setCommand(commandLine);
|
||||
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess
|
||||
if (cpp.result() != ProcessResult::FinishedWithSuccess
|
||||
&& (queryFailMode == QueryFailMode::Noisy
|
||||
|| cpp.result() != QtcProcess::FinishedWithError)) {
|
||||
|| cpp.result() != ProcessResult::FinishedWithError)) {
|
||||
Core::MessageManager::writeFlashing(cpp.exitMessage());
|
||||
Core::MessageManager::writeFlashing(QString::fromUtf8(cpp.allRawOutput()));
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user