forked from qt-creator/qt-creator
Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102 Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -401,7 +401,7 @@ QString PluginManager::systemInformation()
|
||||
QString result;
|
||||
CommandLine qtDiag(FilePath::fromString(QLibraryInfo::location(QLibraryInfo::BinariesPath))
|
||||
.pathAppended("qtdiag").withExecutableSuffix());
|
||||
QtcProcess qtDiagProc;
|
||||
Process qtDiagProc;
|
||||
qtDiagProc.setCommand(qtDiag);
|
||||
qtDiagProc.runBlocking();
|
||||
if (qtDiagProc.result() == ProcessResult::FinishedWithSuccess)
|
||||
|
||||
@@ -203,7 +203,7 @@ static void printParseWarnings(const FilePath &libraryPath, const QString &warni
|
||||
"%2").arg(libraryPath.toUserOutput(), warning));
|
||||
}
|
||||
|
||||
static QString qmlPluginDumpErrorMessage(QtcProcess *process)
|
||||
static QString qmlPluginDumpErrorMessage(Process *process)
|
||||
{
|
||||
QString errorMessage;
|
||||
const QString binary = process->commandLine().executable().toUserOutput();
|
||||
@@ -237,7 +237,7 @@ static QString qmlPluginDumpErrorMessage(QtcProcess *process)
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
void PluginDumper::qmlPluginTypeDumpDone(QtcProcess *process)
|
||||
void PluginDumper::qmlPluginTypeDumpDone(Process *process)
|
||||
{
|
||||
process->deleteLater();
|
||||
|
||||
@@ -597,11 +597,11 @@ void PluginDumper::loadQmltypesFile(const FilePaths &qmltypesFilePaths,
|
||||
void PluginDumper::runQmlDump(const ModelManagerInterface::ProjectInfo &info,
|
||||
const QStringList &arguments, const FilePath &importPath)
|
||||
{
|
||||
auto process = new QtcProcess(this);
|
||||
auto process = new Process(this);
|
||||
process->setEnvironment(info.qmlDumpEnvironment);
|
||||
process->setWorkingDirectory(importPath);
|
||||
process->setCommand({info.qmlDumpPath, arguments});
|
||||
connect(process, &QtcProcess::done, this, [this, process] { qmlPluginTypeDumpDone(process); });
|
||||
connect(process, &Process::done, this, [this, process] { qmlPluginTypeDumpDone(process); });
|
||||
process->start();
|
||||
m_runningQmldumps.insert(process, importPath);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace Utils {
|
||||
class FileSystemWatcher;
|
||||
class QtcProcess;
|
||||
class Process;
|
||||
}
|
||||
|
||||
namespace QmlJS {
|
||||
@@ -41,7 +41,7 @@ private:
|
||||
const QString &importUri,
|
||||
const QString &importVersion);
|
||||
Q_INVOKABLE void dumpAllPlugins();
|
||||
void qmlPluginTypeDumpDone(Utils::QtcProcess *process);
|
||||
void qmlPluginTypeDumpDone(Utils::Process *process);
|
||||
void pluginChanged(const QString &pluginLibrary);
|
||||
|
||||
private:
|
||||
@@ -102,7 +102,7 @@ private:
|
||||
|
||||
ModelManagerInterface *m_modelManager;
|
||||
Utils::FileSystemWatcher *m_pluginWatcher;
|
||||
QHash<Utils::QtcProcess *, Utils::FilePath> m_runningQmldumps;
|
||||
QHash<Utils::Process *, Utils::FilePath> m_runningQmldumps;
|
||||
QList<Plugin> m_plugins;
|
||||
QHash<Utils::FilePath, int> m_libraryToPluginIndex;
|
||||
QHash<QString, QmlJS::ModelManagerInterface::ProjectInfo> m_qtToInfo;
|
||||
|
||||
@@ -160,12 +160,12 @@ void Archive::unarchive()
|
||||
|
||||
m_workingDirectory.ensureWritableDir();
|
||||
|
||||
m_process.reset(new QtcProcess);
|
||||
m_process.reset(new Process);
|
||||
m_process->setProcessChannelMode(QProcess::MergedChannels);
|
||||
QObject::connect(m_process.get(), &QtcProcess::readyReadStandardOutput, this, [this] {
|
||||
QObject::connect(m_process.get(), &Process::readyReadStandardOutput, this, [this] {
|
||||
emit outputReceived(m_process->readAllStandardOutput());
|
||||
});
|
||||
QObject::connect(m_process.get(), &QtcProcess::done, this, [this] {
|
||||
QObject::connect(m_process.get(), &Process::done, this, [this] {
|
||||
const bool successfulFinish = m_process->result() == ProcessResult::FinishedWithSuccess;
|
||||
if (!successfulFinish)
|
||||
emit outputReceived(Tr::tr("Command failed."));
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace Utils {
|
||||
|
||||
class FilePath;
|
||||
class QtcProcess;
|
||||
class Process;
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Archive : public QObject
|
||||
{
|
||||
@@ -33,7 +33,7 @@ signals:
|
||||
private:
|
||||
CommandLine m_commandLine;
|
||||
FilePath m_workingDirectory;
|
||||
std::unique_ptr<QtcProcess> m_process;
|
||||
std::unique_ptr<Process> m_process;
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
@@ -21,7 +21,7 @@ bool BuildableHelperLibrary::isQtChooser(const FilePath &filePath)
|
||||
FilePath BuildableHelperLibrary::qtChooserToQmakePath(const FilePath &qtChooser)
|
||||
{
|
||||
const QString toolDir = QLatin1String("QTTOOLDIR=\"");
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
proc.setTimeoutS(1);
|
||||
proc.setCommand({qtChooser, {"-print-env"}});
|
||||
proc.runBlocking();
|
||||
@@ -103,7 +103,7 @@ QString BuildableHelperLibrary::qtVersionForQMake(const FilePath &qmakePath)
|
||||
if (qmakePath.isEmpty())
|
||||
return QString();
|
||||
|
||||
QtcProcess qmake;
|
||||
Process qmake;
|
||||
qmake.setTimeoutS(5);
|
||||
qmake.setCommand({qmakePath, {"--version"}});
|
||||
qmake.runBlocking();
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Utils {
|
||||
|
||||
static QVersionNumber getClangdVersion(const FilePath &clangdFilePath)
|
||||
{
|
||||
QtcProcess clangdProc;
|
||||
Process clangdProc;
|
||||
clangdProc.setCommand({clangdFilePath, {"--version"}});
|
||||
clangdProc.runBlocking();
|
||||
if (clangdProc.result() != ProcessResult::FinishedWithSuccess)
|
||||
|
||||
@@ -220,13 +220,13 @@ expected_str<void> DeviceFileAccess::copyRecursively(const FilePath &src,
|
||||
if (isSrcOrTargetQrc || !targetTar.isExecutableFile() || !sourceTar.isExecutableFile())
|
||||
return copyRecursively_fallback(src, target);
|
||||
|
||||
QtcProcess srcProcess;
|
||||
QtcProcess targetProcess;
|
||||
Process srcProcess;
|
||||
Process targetProcess;
|
||||
|
||||
targetProcess.setProcessMode(ProcessMode::Writer);
|
||||
|
||||
QObject::connect(&srcProcess,
|
||||
&QtcProcess::readyReadStandardOutput,
|
||||
&Process::readyReadStandardOutput,
|
||||
&targetProcess,
|
||||
[&srcProcess, &targetProcess]() {
|
||||
targetProcess.writeRaw(srcProcess.readAllRawStandardOutput());
|
||||
@@ -960,7 +960,7 @@ expected_str<QByteArray> UnixDeviceFileAccess::fileContents(const FilePath &file
|
||||
#ifndef UTILS_STATIC_LIBRARY
|
||||
const FilePath dd = filePath.withNewPath("dd");
|
||||
|
||||
QtcProcess p;
|
||||
Process p;
|
||||
p.setCommand({dd, args, OsType::OsTypeLinux});
|
||||
p.runBlocking();
|
||||
if (p.exitCode() != 0) {
|
||||
|
||||
@@ -81,7 +81,7 @@ RunResult DeviceShell::run(const CommandLine &cmd, const QByteArray &stdInData)
|
||||
useProcess |= stdInData.size() > (1024 * 100);
|
||||
|
||||
if (useProcess) {
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
const CommandLine fallbackCmd = createFallbackCommand(cmd);
|
||||
qCDebug(deviceShellLog) << "Running fallback:" << fallbackCmd;
|
||||
proc.setCommand(fallbackCmd);
|
||||
@@ -136,7 +136,7 @@ void DeviceShell::close()
|
||||
* Override this function to setup the shell process.
|
||||
* The default implementation just sets the command line to "bash"
|
||||
*/
|
||||
void DeviceShell::setupShellProcess(QtcProcess *shellProcess)
|
||||
void DeviceShell::setupShellProcess(Process *shellProcess)
|
||||
{
|
||||
shellProcess->setCommand(CommandLine{"bash"});
|
||||
}
|
||||
@@ -171,8 +171,8 @@ void DeviceShell::startupFailed(const CommandLine &cmdLine)
|
||||
*/
|
||||
bool DeviceShell::start()
|
||||
{
|
||||
m_shellProcess = std::make_unique<QtcProcess>();
|
||||
connect(m_shellProcess.get(), &QtcProcess::done, m_shellProcess.get(),
|
||||
m_shellProcess = std::make_unique<Process>();
|
||||
connect(m_shellProcess.get(), &Process::done, m_shellProcess.get(),
|
||||
[this] { emit done(m_shellProcess->resultData()); });
|
||||
connect(&m_thread, &QThread::finished, m_shellProcess.get(), [this] { closeShellProcess(); }, Qt::DirectConnection);
|
||||
|
||||
@@ -199,11 +199,11 @@ bool DeviceShell::start()
|
||||
|
||||
if (installShellScript()) {
|
||||
connect(m_shellProcess.get(),
|
||||
&QtcProcess::readyReadStandardOutput,
|
||||
&Process::readyReadStandardOutput,
|
||||
m_shellProcess.get(),
|
||||
[this] { onReadyRead(); });
|
||||
connect(m_shellProcess.get(),
|
||||
&QtcProcess::readyReadStandardError,
|
||||
&Process::readyReadStandardError,
|
||||
m_shellProcess.get(),
|
||||
[this] {
|
||||
const QByteArray stdErr = m_shellProcess->readAllRawStandardError();
|
||||
@@ -216,7 +216,7 @@ bool DeviceShell::start()
|
||||
return false;
|
||||
}
|
||||
|
||||
connect(m_shellProcess.get(), &QtcProcess::done, m_shellProcess.get(), [this] {
|
||||
connect(m_shellProcess.get(), &Process::done, m_shellProcess.get(), [this] {
|
||||
if (m_shellProcess->resultData().m_exitCode != EXIT_SUCCESS
|
||||
|| m_shellProcess->resultData().m_exitStatus != QProcess::NormalExit) {
|
||||
qCWarning(deviceShellLog) << "Shell exited with error code:"
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Utils {
|
||||
|
||||
class CommandLine;
|
||||
class ProcessResultData;
|
||||
class QtcProcess;
|
||||
class Process;
|
||||
|
||||
class DeviceShellImpl;
|
||||
|
||||
@@ -57,7 +57,7 @@ protected:
|
||||
void close();
|
||||
|
||||
private:
|
||||
virtual void setupShellProcess(QtcProcess *shellProcess);
|
||||
virtual void setupShellProcess(Process *shellProcess);
|
||||
virtual CommandLine createFallbackCommand(const CommandLine &cmdLine);
|
||||
|
||||
bool installShellScript();
|
||||
@@ -73,7 +73,7 @@ private:
|
||||
QWaitCondition *waiter;
|
||||
};
|
||||
|
||||
std::unique_ptr<QtcProcess> m_shellProcess;
|
||||
std::unique_ptr<Process> m_shellProcess;
|
||||
QThread m_thread;
|
||||
int m_currentId{0};
|
||||
|
||||
|
||||
@@ -84,12 +84,12 @@ signals:
|
||||
|
||||
private:
|
||||
TaskItem remoteTask() final {
|
||||
const auto setup = [this](QtcProcess &process) {
|
||||
const auto setup = [this](Process &process) {
|
||||
const QStringList args = {"if=" + m_filePath.path()};
|
||||
const FilePath dd = m_filePath.withNewPath("dd");
|
||||
process.setCommand({dd, args, OsType::OsTypeLinux});
|
||||
QtcProcess *processPtr = &process;
|
||||
connect(processPtr, &QtcProcess::readyReadStandardOutput, this, [this, processPtr] {
|
||||
Process *processPtr = &process;
|
||||
connect(processPtr, &Process::readyReadStandardOutput, this, [this, processPtr] {
|
||||
emit readyRead(processPtr->readAllRawStandardOutput());
|
||||
});
|
||||
};
|
||||
@@ -246,11 +246,11 @@ signals:
|
||||
|
||||
private:
|
||||
TaskItem remoteTask() final {
|
||||
const auto setup = [this](QtcProcess &process) {
|
||||
const auto setup = [this](Process &process) {
|
||||
m_writeBuffer = new WriteBuffer(false, &process);
|
||||
connect(m_writeBuffer, &WriteBuffer::writeRequested, &process, &QtcProcess::writeRaw);
|
||||
connect(m_writeBuffer, &WriteBuffer::writeRequested, &process, &Process::writeRaw);
|
||||
connect(m_writeBuffer, &WriteBuffer::closeWriteChannelRequested,
|
||||
&process, &QtcProcess::closeWriteChannel);
|
||||
&process, &Process::closeWriteChannel);
|
||||
const QStringList args = {"of=" + m_filePath.path()};
|
||||
const FilePath dd = m_filePath.withNewPath("dd");
|
||||
process.setCommand({dd, args, OsType::OsTypeLinux});
|
||||
@@ -258,9 +258,9 @@ private:
|
||||
process.setProcessMode(ProcessMode::Writer);
|
||||
else
|
||||
process.setWriteData(m_writeData);
|
||||
connect(&process, &QtcProcess::started, this, [this] { emit started(); });
|
||||
connect(&process, &Process::started, this, [this] { emit started(); });
|
||||
};
|
||||
const auto finalize = [this](const QtcProcess &) {
|
||||
const auto finalize = [this](const Process &) {
|
||||
delete m_writeBuffer;
|
||||
m_writeBuffer = nullptr;
|
||||
};
|
||||
@@ -311,7 +311,7 @@ static Group sameRemoteDeviceTransferTask(const FilePath &source, const FilePath
|
||||
QTC_CHECK(destination.needsDevice());
|
||||
QTC_CHECK(source.isSameDevice(destination));
|
||||
|
||||
const auto setup = [source, destination](QtcProcess &process) {
|
||||
const auto setup = [source, destination](Process &process) {
|
||||
const QStringList args = {source.path(), destination.path()};
|
||||
const FilePath cp = source.withNewPath("cp");
|
||||
process.setCommand({cp, args, OsType::OsTypeLinux});
|
||||
|
||||
@@ -130,7 +130,7 @@ QString BinaryVersionToolTipEventFilter::toolVersion(const CommandLine &cmd)
|
||||
{
|
||||
if (cmd.executable().isEmpty())
|
||||
return QString();
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
proc.setTimeoutS(1);
|
||||
proc.setCommand(cmd);
|
||||
proc.runBlocking();
|
||||
|
||||
@@ -50,7 +50,7 @@ static QList<ProcessInfo> getLocalProcessesUsingProc(const FilePath &procDir)
|
||||
|
||||
cmd.addArgs(execs, CommandLine::Raw);
|
||||
|
||||
QtcProcess procProcess;
|
||||
Process procProcess;
|
||||
procProcess.setCommand(cmd);
|
||||
procProcess.runBlocking();
|
||||
|
||||
@@ -83,7 +83,7 @@ static QList<ProcessInfo> getLocalProcessesUsingProc(const FilePath &procDir)
|
||||
static QMap<qint64, QString> getLocalProcessDataUsingPs(const FilePath &deviceRoot,
|
||||
const QString &column)
|
||||
{
|
||||
QtcProcess process;
|
||||
Process process;
|
||||
process.setCommand({deviceRoot.withNewPath("ps"), {"-e", "-o", "pid," + column}});
|
||||
process.runBlocking();
|
||||
|
||||
@@ -129,7 +129,7 @@ static QList<ProcessInfo> getLocalProcessesUsingPs(const FilePath &deviceRoot)
|
||||
|
||||
static QList<ProcessInfo> getProcessesUsingPidin(const FilePath &pidin)
|
||||
{
|
||||
QtcProcess process;
|
||||
Process process;
|
||||
process.setCommand({pidin, {"-F", "%a %A {/%n}"}});
|
||||
process.runBlocking();
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ private:
|
||||
|
||||
virtual ProcessBlockingInterface *processBlockingInterface() const { return nullptr; }
|
||||
|
||||
friend class QtcProcess;
|
||||
friend class Process;
|
||||
friend class Internal::QtcProcessPrivate;
|
||||
};
|
||||
|
||||
|
||||
@@ -717,7 +717,7 @@ private:
|
||||
class QtcProcessPrivate : public QObject
|
||||
{
|
||||
public:
|
||||
explicit QtcProcessPrivate(QtcProcess *parent)
|
||||
explicit QtcProcessPrivate(Process *parent)
|
||||
: QObject(parent)
|
||||
, q(parent)
|
||||
, m_killTimer(this)
|
||||
@@ -775,7 +775,7 @@ public:
|
||||
return rootCommand;
|
||||
}
|
||||
|
||||
QtcProcess *q;
|
||||
Process *q;
|
||||
std::unique_ptr<ProcessBlockingInterface> m_blockingInterface;
|
||||
std::unique_ptr<ProcessInterface> m_process;
|
||||
ProcessSetupData m_setup;
|
||||
@@ -786,7 +786,7 @@ public:
|
||||
void handleDone(const ProcessResultData &data);
|
||||
void clearForRun();
|
||||
|
||||
void emitGuardedSignal(void (QtcProcess::* signalName)()) {
|
||||
void emitGuardedSignal(void (Process::* signalName)()) {
|
||||
GuardLocker locker(m_guard);
|
||||
emit (q->*signalName)();
|
||||
}
|
||||
@@ -1092,7 +1092,7 @@ ProcessResult QtcProcessPrivate::interpretExitCode(int exitCode)
|
||||
\sa Utils::ProcessArgs
|
||||
*/
|
||||
|
||||
QtcProcess::QtcProcess(QObject *parent)
|
||||
Process::Process(QObject *parent)
|
||||
: QObject(parent),
|
||||
d(new QtcProcessPrivate(this))
|
||||
{
|
||||
@@ -1103,7 +1103,7 @@ QtcProcess::QtcProcess(QObject *parent)
|
||||
Q_UNUSED(qProcessProcessErrorMeta)
|
||||
}
|
||||
|
||||
QtcProcess::~QtcProcess()
|
||||
Process::~Process()
|
||||
{
|
||||
QTC_ASSERT(!d->m_guard.isLocked(), qWarning("Deleting QtcProcess instance directly from "
|
||||
"one of its signal handlers will lead to crash!"));
|
||||
@@ -1112,62 +1112,62 @@ QtcProcess::~QtcProcess()
|
||||
delete d;
|
||||
}
|
||||
|
||||
void QtcProcess::setProcessImpl(ProcessImpl processImpl)
|
||||
void Process::setProcessImpl(ProcessImpl processImpl)
|
||||
{
|
||||
d->m_setup.m_processImpl = processImpl;
|
||||
}
|
||||
|
||||
void QtcProcess::setPtyData(const std::optional<Pty::Data> &data)
|
||||
void Process::setPtyData(const std::optional<Pty::Data> &data)
|
||||
{
|
||||
d->m_setup.m_ptyData = data;
|
||||
}
|
||||
|
||||
std::optional<Pty::Data> QtcProcess::ptyData() const
|
||||
std::optional<Pty::Data> Process::ptyData() const
|
||||
{
|
||||
return d->m_setup.m_ptyData;
|
||||
}
|
||||
|
||||
ProcessMode QtcProcess::processMode() const
|
||||
ProcessMode Process::processMode() const
|
||||
{
|
||||
return d->m_setup.m_processMode;
|
||||
}
|
||||
|
||||
void QtcProcess::setTerminalMode(TerminalMode mode)
|
||||
void Process::setTerminalMode(TerminalMode mode)
|
||||
{
|
||||
d->m_setup.m_terminalMode = mode;
|
||||
}
|
||||
|
||||
TerminalMode QtcProcess::terminalMode() const
|
||||
TerminalMode Process::terminalMode() const
|
||||
{
|
||||
return d->m_setup.m_terminalMode;
|
||||
}
|
||||
|
||||
void QtcProcess::setProcessMode(ProcessMode processMode)
|
||||
void Process::setProcessMode(ProcessMode processMode)
|
||||
{
|
||||
d->m_setup.m_processMode = processMode;
|
||||
}
|
||||
|
||||
void QtcProcess::setEnvironment(const Environment &env)
|
||||
void Process::setEnvironment(const Environment &env)
|
||||
{
|
||||
d->m_setup.m_environment = env;
|
||||
}
|
||||
|
||||
const Environment &QtcProcess::environment() const
|
||||
const Environment &Process::environment() const
|
||||
{
|
||||
return d->m_setup.m_environment;
|
||||
}
|
||||
|
||||
void QtcProcess::setControlEnvironment(const Environment &environment)
|
||||
void Process::setControlEnvironment(const Environment &environment)
|
||||
{
|
||||
d->m_setup.m_controlEnvironment = environment;
|
||||
}
|
||||
|
||||
const Environment &QtcProcess::controlEnvironment() const
|
||||
const Environment &Process::controlEnvironment() const
|
||||
{
|
||||
return d->m_setup.m_controlEnvironment;
|
||||
}
|
||||
|
||||
void QtcProcess::setCommand(const CommandLine &cmdLine)
|
||||
void Process::setCommand(const CommandLine &cmdLine)
|
||||
{
|
||||
if (d->m_setup.m_workingDirectory.needsDevice() && cmdLine.executable().needsDevice()) {
|
||||
QTC_CHECK(d->m_setup.m_workingDirectory.host() == cmdLine.executable().host());
|
||||
@@ -1175,17 +1175,17 @@ void QtcProcess::setCommand(const CommandLine &cmdLine)
|
||||
d->m_setup.m_commandLine = cmdLine;
|
||||
}
|
||||
|
||||
const CommandLine &QtcProcess::commandLine() const
|
||||
const CommandLine &Process::commandLine() const
|
||||
{
|
||||
return d->m_setup.m_commandLine;
|
||||
}
|
||||
|
||||
FilePath QtcProcess::workingDirectory() const
|
||||
FilePath Process::workingDirectory() const
|
||||
{
|
||||
return d->m_setup.m_workingDirectory;
|
||||
}
|
||||
|
||||
void QtcProcess::setWorkingDirectory(const FilePath &dir)
|
||||
void Process::setWorkingDirectory(const FilePath &dir)
|
||||
{
|
||||
if (dir.needsDevice() && d->m_setup.m_commandLine.executable().needsDevice()) {
|
||||
QTC_CHECK(dir.host() == d->m_setup.m_commandLine.executable().host());
|
||||
@@ -1193,12 +1193,12 @@ void QtcProcess::setWorkingDirectory(const FilePath &dir)
|
||||
d->m_setup.m_workingDirectory = dir;
|
||||
}
|
||||
|
||||
void QtcProcess::setUseCtrlCStub(bool enabled)
|
||||
void Process::setUseCtrlCStub(bool enabled)
|
||||
{
|
||||
d->m_setup.m_useCtrlCStub = enabled;
|
||||
}
|
||||
|
||||
void QtcProcess::start()
|
||||
void Process::start()
|
||||
{
|
||||
QTC_ASSERT(state() == QProcess::NotRunning, return);
|
||||
QTC_ASSERT(!(d->m_process && d->m_guard.isLocked()),
|
||||
@@ -1217,36 +1217,36 @@ void QtcProcess::start()
|
||||
d->m_state = QProcess::Starting;
|
||||
d->m_process->m_setup = d->m_setup;
|
||||
d->m_process->m_setup.m_commandLine = d->fullCommandLine();
|
||||
d->emitGuardedSignal(&QtcProcess::starting);
|
||||
d->emitGuardedSignal(&Process::starting);
|
||||
d->m_process->start();
|
||||
}
|
||||
|
||||
void QtcProcess::terminate()
|
||||
void Process::terminate()
|
||||
{
|
||||
d->sendControlSignal(ControlSignal::Terminate);
|
||||
}
|
||||
|
||||
void QtcProcess::kill()
|
||||
void Process::kill()
|
||||
{
|
||||
d->sendControlSignal(ControlSignal::Kill);
|
||||
}
|
||||
|
||||
void QtcProcess::interrupt()
|
||||
void Process::interrupt()
|
||||
{
|
||||
d->sendControlSignal(ControlSignal::Interrupt);
|
||||
}
|
||||
|
||||
void QtcProcess::kickoffProcess()
|
||||
void Process::kickoffProcess()
|
||||
{
|
||||
d->sendControlSignal(ControlSignal::KickOff);
|
||||
}
|
||||
|
||||
void QtcProcess::closeWriteChannel()
|
||||
void Process::closeWriteChannel()
|
||||
{
|
||||
d->sendControlSignal(ControlSignal::CloseWriteChannel);
|
||||
}
|
||||
|
||||
bool QtcProcess::startDetached(const CommandLine &cmd, const FilePath &workingDirectory, qint64 *pid)
|
||||
bool Process::startDetached(const CommandLine &cmd, const FilePath &workingDirectory, qint64 *pid)
|
||||
{
|
||||
return QProcess::startDetached(cmd.executable().toUserOutput(),
|
||||
cmd.splitArguments(),
|
||||
@@ -1254,37 +1254,37 @@ bool QtcProcess::startDetached(const CommandLine &cmd, const FilePath &workingDi
|
||||
pid);
|
||||
}
|
||||
|
||||
void QtcProcess::setLowPriority()
|
||||
void Process::setLowPriority()
|
||||
{
|
||||
d->m_setup.m_lowPriority = true;
|
||||
}
|
||||
|
||||
void QtcProcess::setDisableUnixTerminal()
|
||||
void Process::setDisableUnixTerminal()
|
||||
{
|
||||
d->m_setup.m_unixTerminalDisabled = true;
|
||||
}
|
||||
|
||||
void QtcProcess::setAbortOnMetaChars(bool abort)
|
||||
void Process::setAbortOnMetaChars(bool abort)
|
||||
{
|
||||
d->m_setup.m_abortOnMetaChars = abort;
|
||||
}
|
||||
|
||||
void QtcProcess::setRunAsRoot(bool on)
|
||||
void Process::setRunAsRoot(bool on)
|
||||
{
|
||||
d->m_setup.m_runAsRoot = on;
|
||||
}
|
||||
|
||||
bool QtcProcess::isRunAsRoot() const
|
||||
bool Process::isRunAsRoot() const
|
||||
{
|
||||
return d->m_setup.m_runAsRoot;
|
||||
}
|
||||
|
||||
void QtcProcess::setStandardInputFile(const QString &inputFile)
|
||||
void Process::setStandardInputFile(const QString &inputFile)
|
||||
{
|
||||
d->m_setup.m_standardInputFile = inputFile;
|
||||
}
|
||||
|
||||
QString QtcProcess::toStandaloneCommandLine() const
|
||||
QString Process::toStandaloneCommandLine() const
|
||||
{
|
||||
QStringList parts;
|
||||
parts.append("/usr/bin/env");
|
||||
@@ -1303,47 +1303,47 @@ QString QtcProcess::toStandaloneCommandLine() const
|
||||
return parts.join(" ");
|
||||
}
|
||||
|
||||
void QtcProcess::setCreateConsoleOnWindows(bool create)
|
||||
void Process::setCreateConsoleOnWindows(bool create)
|
||||
{
|
||||
d->m_setup.m_createConsoleOnWindows = create;
|
||||
}
|
||||
|
||||
bool QtcProcess::createConsoleOnWindows() const
|
||||
bool Process::createConsoleOnWindows() const
|
||||
{
|
||||
return d->m_setup.m_createConsoleOnWindows;
|
||||
}
|
||||
|
||||
void QtcProcess::setExtraData(const QString &key, const QVariant &value)
|
||||
void Process::setExtraData(const QString &key, const QVariant &value)
|
||||
{
|
||||
d->m_setup.m_extraData.insert(key, value);
|
||||
}
|
||||
|
||||
QVariant QtcProcess::extraData(const QString &key) const
|
||||
QVariant Process::extraData(const QString &key) const
|
||||
{
|
||||
return d->m_setup.m_extraData.value(key);
|
||||
}
|
||||
|
||||
void QtcProcess::setExtraData(const QVariantHash &extraData)
|
||||
void Process::setExtraData(const QVariantHash &extraData)
|
||||
{
|
||||
d->m_setup.m_extraData = extraData;
|
||||
}
|
||||
|
||||
QVariantHash QtcProcess::extraData() const
|
||||
QVariantHash Process::extraData() const
|
||||
{
|
||||
return d->m_setup.m_extraData;
|
||||
}
|
||||
|
||||
void QtcProcess::setReaperTimeout(int msecs)
|
||||
void Process::setReaperTimeout(int msecs)
|
||||
{
|
||||
d->m_setup.m_reaperTimeout = msecs;
|
||||
}
|
||||
|
||||
int QtcProcess::reaperTimeout() const
|
||||
int Process::reaperTimeout() const
|
||||
{
|
||||
return d->m_setup.m_reaperTimeout;
|
||||
}
|
||||
|
||||
void QtcProcess::setRemoteProcessHooks(const DeviceProcessHooks &hooks)
|
||||
void Process::setRemoteProcessHooks(const DeviceProcessHooks &hooks)
|
||||
{
|
||||
s_deviceHooks = hooks;
|
||||
}
|
||||
@@ -1378,7 +1378,7 @@ static bool askToKill(const CommandLine &command)
|
||||
// occurs on stderr/stdout as opposed to waitForFinished()). Returns false if a timeout
|
||||
// occurs. Checking of the process' exit state/code still has to be done.
|
||||
|
||||
bool QtcProcess::readDataFromProcess(QByteArray *stdOut, QByteArray *stdErr, int timeoutS)
|
||||
bool Process::readDataFromProcess(QByteArray *stdOut, QByteArray *stdErr, int timeoutS)
|
||||
{
|
||||
enum { syncDebug = 0 };
|
||||
if (syncDebug)
|
||||
@@ -1418,39 +1418,39 @@ bool QtcProcess::readDataFromProcess(QByteArray *stdOut, QByteArray *stdErr, int
|
||||
return finished;
|
||||
}
|
||||
|
||||
ProcessResult QtcProcess::result() const
|
||||
ProcessResult Process::result() const
|
||||
{
|
||||
return d->m_result;
|
||||
}
|
||||
|
||||
ProcessResultData QtcProcess::resultData() const
|
||||
ProcessResultData Process::resultData() const
|
||||
{
|
||||
return d->m_resultData;
|
||||
}
|
||||
|
||||
int QtcProcess::exitCode() const
|
||||
int Process::exitCode() const
|
||||
{
|
||||
return resultData().m_exitCode;
|
||||
}
|
||||
|
||||
QProcess::ExitStatus QtcProcess::exitStatus() const
|
||||
QProcess::ExitStatus Process::exitStatus() const
|
||||
{
|
||||
return resultData().m_exitStatus;
|
||||
}
|
||||
|
||||
QProcess::ProcessError QtcProcess::error() const
|
||||
QProcess::ProcessError Process::error() const
|
||||
{
|
||||
return resultData().m_error;
|
||||
}
|
||||
|
||||
QString QtcProcess::errorString() const
|
||||
QString Process::errorString() const
|
||||
{
|
||||
return resultData().m_errorString;
|
||||
}
|
||||
|
||||
// Path utilities
|
||||
|
||||
Environment QtcProcess::systemEnvironmentForBinary(const FilePath &filePath)
|
||||
Environment Process::systemEnvironmentForBinary(const FilePath &filePath)
|
||||
{
|
||||
if (filePath.needsDevice()) {
|
||||
QTC_ASSERT(s_deviceHooks.systemEnvironmentForBinary, return {});
|
||||
@@ -1460,37 +1460,37 @@ Environment QtcProcess::systemEnvironmentForBinary(const FilePath &filePath)
|
||||
return Environment::systemEnvironment();
|
||||
}
|
||||
|
||||
qint64 QtcProcess::applicationMainThreadId() const
|
||||
qint64 Process::applicationMainThreadId() const
|
||||
{
|
||||
return d->m_applicationMainThreadId;
|
||||
}
|
||||
|
||||
QProcess::ProcessChannelMode QtcProcess::processChannelMode() const
|
||||
QProcess::ProcessChannelMode Process::processChannelMode() const
|
||||
{
|
||||
return d->m_setup.m_processChannelMode;
|
||||
}
|
||||
|
||||
void QtcProcess::setProcessChannelMode(QProcess::ProcessChannelMode mode)
|
||||
void Process::setProcessChannelMode(QProcess::ProcessChannelMode mode)
|
||||
{
|
||||
d->m_setup.m_processChannelMode = mode;
|
||||
}
|
||||
|
||||
QProcess::ProcessState QtcProcess::state() const
|
||||
QProcess::ProcessState Process::state() const
|
||||
{
|
||||
return d->m_state;
|
||||
}
|
||||
|
||||
bool QtcProcess::isRunning() const
|
||||
bool Process::isRunning() const
|
||||
{
|
||||
return state() == QProcess::Running;
|
||||
}
|
||||
|
||||
qint64 QtcProcess::processId() const
|
||||
qint64 Process::processId() const
|
||||
{
|
||||
return d->m_processId;
|
||||
}
|
||||
|
||||
bool QtcProcess::waitForStarted(int msecs)
|
||||
bool Process::waitForStarted(int msecs)
|
||||
{
|
||||
QTC_ASSERT(d->m_process, return false);
|
||||
if (d->m_state == QProcess::Running)
|
||||
@@ -1501,7 +1501,7 @@ bool QtcProcess::waitForStarted(int msecs)
|
||||
ProcessSignalType::Started, msecs);
|
||||
}
|
||||
|
||||
bool QtcProcess::waitForReadyRead(int msecs)
|
||||
bool Process::waitForReadyRead(int msecs)
|
||||
{
|
||||
QTC_ASSERT(d->m_process, return false);
|
||||
if (d->m_state == QProcess::NotRunning)
|
||||
@@ -1509,7 +1509,7 @@ bool QtcProcess::waitForReadyRead(int msecs)
|
||||
return d->waitForSignal(ProcessSignalType::ReadyRead, msecs);
|
||||
}
|
||||
|
||||
bool QtcProcess::waitForFinished(int msecs)
|
||||
bool Process::waitForFinished(int msecs)
|
||||
{
|
||||
QTC_ASSERT(d->m_process, return false);
|
||||
if (d->m_state == QProcess::NotRunning)
|
||||
@@ -1517,17 +1517,17 @@ bool QtcProcess::waitForFinished(int msecs)
|
||||
return d->waitForSignal(ProcessSignalType::Done, msecs);
|
||||
}
|
||||
|
||||
QByteArray QtcProcess::readAllRawStandardOutput()
|
||||
QByteArray Process::readAllRawStandardOutput()
|
||||
{
|
||||
return d->m_stdOut.readAllData();
|
||||
}
|
||||
|
||||
QByteArray QtcProcess::readAllRawStandardError()
|
||||
QByteArray Process::readAllRawStandardError()
|
||||
{
|
||||
return d->m_stdErr.readAllData();
|
||||
}
|
||||
|
||||
qint64 QtcProcess::write(const QString &input)
|
||||
qint64 Process::write(const QString &input)
|
||||
{
|
||||
// Non-windows is assumed to be UTF-8
|
||||
if (commandLine().executable().osType() != OsTypeWindows)
|
||||
@@ -1542,7 +1542,7 @@ qint64 QtcProcess::write(const QString &input)
|
||||
return writeRaw(input.toUtf8());
|
||||
}
|
||||
|
||||
qint64 QtcProcess::writeRaw(const QByteArray &input)
|
||||
qint64 Process::writeRaw(const QByteArray &input)
|
||||
{
|
||||
QTC_ASSERT(processMode() == ProcessMode::Writer, return -1);
|
||||
QTC_ASSERT(d->m_process, return -1);
|
||||
@@ -1555,7 +1555,7 @@ qint64 QtcProcess::writeRaw(const QByteArray &input)
|
||||
return result;
|
||||
}
|
||||
|
||||
void QtcProcess::close()
|
||||
void Process::close()
|
||||
{
|
||||
QTC_ASSERT(QThread::currentThread() == thread(), return);
|
||||
if (d->m_process) {
|
||||
@@ -1575,7 +1575,7 @@ void QtcProcess::close()
|
||||
Calls terminate() directly and after a delay of reaperTimeout() it calls kill()
|
||||
if the process is still running.
|
||||
*/
|
||||
void QtcProcess::stop()
|
||||
void Process::stop()
|
||||
{
|
||||
if (state() == QProcess::NotRunning)
|
||||
return;
|
||||
@@ -1584,12 +1584,12 @@ void QtcProcess::stop()
|
||||
d->m_killTimer.start(d->m_process->m_setup.m_reaperTimeout);
|
||||
}
|
||||
|
||||
QString QtcProcess::readAllStandardOutput()
|
||||
QString Process::readAllStandardOutput()
|
||||
{
|
||||
return QString::fromUtf8(readAllRawStandardOutput());
|
||||
}
|
||||
|
||||
QString QtcProcess::readAllStandardError()
|
||||
QString Process::readAllStandardError()
|
||||
{
|
||||
return QString::fromUtf8(readAllRawStandardError());
|
||||
}
|
||||
@@ -1624,7 +1624,7 @@ QString QtcProcess::readAllStandardError()
|
||||
as this will cause event loop problems.
|
||||
*/
|
||||
|
||||
QString QtcProcess::exitMessage() const
|
||||
QString Process::exitMessage() const
|
||||
{
|
||||
const QString fullCmd = commandLine().toUserOutput();
|
||||
switch (result()) {
|
||||
@@ -1644,7 +1644,7 @@ QString QtcProcess::exitMessage() const
|
||||
return {};
|
||||
}
|
||||
|
||||
QByteArray QtcProcess::allRawOutput() const
|
||||
QByteArray Process::allRawOutput() const
|
||||
{
|
||||
QTC_CHECK(d->m_stdOut.keepRawData);
|
||||
QTC_CHECK(d->m_stdErr.keepRawData);
|
||||
@@ -1658,7 +1658,7 @@ QByteArray QtcProcess::allRawOutput() const
|
||||
return !d->m_stdOut.rawData.isEmpty() ? d->m_stdOut.rawData : d->m_stdErr.rawData;
|
||||
}
|
||||
|
||||
QString QtcProcess::allOutput() const
|
||||
QString Process::allOutput() const
|
||||
{
|
||||
QTC_CHECK(d->m_stdOut.keepRawData);
|
||||
QTC_CHECK(d->m_stdErr.keepRawData);
|
||||
@@ -1675,30 +1675,30 @@ QString QtcProcess::allOutput() const
|
||||
return !out.isEmpty() ? out : err;
|
||||
}
|
||||
|
||||
QByteArray QtcProcess::rawStdOut() const
|
||||
QByteArray Process::rawStdOut() const
|
||||
{
|
||||
QTC_CHECK(d->m_stdOut.keepRawData);
|
||||
return d->m_stdOut.rawData;
|
||||
}
|
||||
|
||||
QString QtcProcess::stdOut() const
|
||||
QString Process::stdOut() const
|
||||
{
|
||||
QTC_CHECK(d->m_stdOut.keepRawData);
|
||||
return d->m_codec->toUnicode(d->m_stdOut.rawData);
|
||||
}
|
||||
|
||||
QString QtcProcess::stdErr() const
|
||||
QString Process::stdErr() const
|
||||
{
|
||||
QTC_CHECK(d->m_stdErr.keepRawData);
|
||||
return d->m_codec->toUnicode(d->m_stdErr.rawData);
|
||||
}
|
||||
|
||||
QString QtcProcess::cleanedStdOut() const
|
||||
QString Process::cleanedStdOut() const
|
||||
{
|
||||
return Utils::normalizeNewlines(stdOut());
|
||||
}
|
||||
|
||||
QString QtcProcess::cleanedStdErr() const
|
||||
QString Process::cleanedStdErr() const
|
||||
{
|
||||
return Utils::normalizeNewlines(stdErr());
|
||||
}
|
||||
@@ -1713,17 +1713,17 @@ static QStringList splitLines(const QString &text)
|
||||
return result;
|
||||
}
|
||||
|
||||
const QStringList QtcProcess::stdOutLines() const
|
||||
const QStringList Process::stdOutLines() const
|
||||
{
|
||||
return splitLines(cleanedStdOut());
|
||||
}
|
||||
|
||||
const QStringList QtcProcess::stdErrLines() const
|
||||
const QStringList Process::stdErrLines() const
|
||||
{
|
||||
return splitLines(cleanedStdErr());
|
||||
}
|
||||
|
||||
QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug str, const QtcProcess &r)
|
||||
QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug str, const Process &r)
|
||||
{
|
||||
QDebug nsp = str.nospace();
|
||||
nsp << "QtcProcess: result="
|
||||
@@ -1802,7 +1802,7 @@ void ChannelBuffer::handleRest()
|
||||
}
|
||||
}
|
||||
|
||||
void QtcProcess::setTimeoutS(int timeoutS)
|
||||
void Process::setTimeoutS(int timeoutS)
|
||||
{
|
||||
if (timeoutS > 0)
|
||||
d->m_maxHangTimerCount = qMax(2, timeoutS);
|
||||
@@ -1810,33 +1810,33 @@ void QtcProcess::setTimeoutS(int timeoutS)
|
||||
d->m_maxHangTimerCount = INT_MAX / 1000;
|
||||
}
|
||||
|
||||
int QtcProcess::timeoutS() const
|
||||
int Process::timeoutS() const
|
||||
{
|
||||
return d->m_maxHangTimerCount;
|
||||
}
|
||||
|
||||
void QtcProcess::setCodec(QTextCodec *c)
|
||||
void Process::setCodec(QTextCodec *c)
|
||||
{
|
||||
QTC_ASSERT(c, return);
|
||||
d->m_codec = c;
|
||||
}
|
||||
|
||||
void QtcProcess::setTimeOutMessageBoxEnabled(bool v)
|
||||
void Process::setTimeOutMessageBoxEnabled(bool v)
|
||||
{
|
||||
d->m_timeOutMessageBoxEnabled = v;
|
||||
}
|
||||
|
||||
void QtcProcess::setExitCodeInterpreter(const ExitCodeInterpreter &interpreter)
|
||||
void Process::setExitCodeInterpreter(const ExitCodeInterpreter &interpreter)
|
||||
{
|
||||
d->m_exitCodeInterpreter = interpreter;
|
||||
}
|
||||
|
||||
void QtcProcess::setWriteData(const QByteArray &writeData)
|
||||
void Process::setWriteData(const QByteArray &writeData)
|
||||
{
|
||||
d->m_setup.m_writeData = writeData;
|
||||
}
|
||||
|
||||
void QtcProcess::runBlocking(EventLoopMode eventLoopMode)
|
||||
void Process::runBlocking(EventLoopMode eventLoopMode)
|
||||
{
|
||||
// Attach a dynamic property with info about blocking type
|
||||
d->storeEventLoopDebugInfo(int(eventLoopMode));
|
||||
@@ -1845,7 +1845,7 @@ void QtcProcess::runBlocking(EventLoopMode eventLoopMode)
|
||||
static const int blockingThresholdMs = qtcEnvironmentVariableIntValue("QTC_PROCESS_THRESHOLD");
|
||||
if (blockingThresholdMs > 0 && isMainThread())
|
||||
startTime = QDateTime::currentDateTime();
|
||||
QtcProcess::start();
|
||||
Process::start();
|
||||
|
||||
// Remove the dynamic property so that it's not reused in subseqent start()
|
||||
d->storeEventLoopDebugInfo({});
|
||||
@@ -1897,33 +1897,33 @@ void QtcProcess::runBlocking(EventLoopMode eventLoopMode)
|
||||
}
|
||||
}
|
||||
|
||||
void QtcProcess::setStdOutCallback(const TextChannelCallback &callback)
|
||||
void Process::setStdOutCallback(const TextChannelCallback &callback)
|
||||
{
|
||||
d->m_stdOut.outputCallback = callback;
|
||||
d->m_stdOut.emitSingleLines = false;
|
||||
}
|
||||
|
||||
void QtcProcess::setStdOutLineCallback(const TextChannelCallback &callback)
|
||||
void Process::setStdOutLineCallback(const TextChannelCallback &callback)
|
||||
{
|
||||
d->m_stdOut.outputCallback = callback;
|
||||
d->m_stdOut.emitSingleLines = true;
|
||||
d->m_stdOut.keepRawData = false;
|
||||
}
|
||||
|
||||
void QtcProcess::setStdErrCallback(const TextChannelCallback &callback)
|
||||
void Process::setStdErrCallback(const TextChannelCallback &callback)
|
||||
{
|
||||
d->m_stdErr.outputCallback = callback;
|
||||
d->m_stdErr.emitSingleLines = false;
|
||||
}
|
||||
|
||||
void QtcProcess::setStdErrLineCallback(const TextChannelCallback &callback)
|
||||
void Process::setStdErrLineCallback(const TextChannelCallback &callback)
|
||||
{
|
||||
d->m_stdErr.outputCallback = callback;
|
||||
d->m_stdErr.emitSingleLines = true;
|
||||
d->m_stdErr.keepRawData = false;
|
||||
}
|
||||
|
||||
void QtcProcess::setTextChannelMode(Channel channel, TextChannelMode mode)
|
||||
void Process::setTextChannelMode(Channel channel, TextChannelMode mode)
|
||||
{
|
||||
const TextChannelCallback outputCb = [this](const QString &text) {
|
||||
GuardLocker locker(d->m_guard);
|
||||
@@ -1959,7 +1959,7 @@ void QtcProcess::setTextChannelMode(Channel channel, TextChannelMode mode)
|
||||
}
|
||||
}
|
||||
|
||||
TextChannelMode QtcProcess::textChannelMode(Channel channel) const
|
||||
TextChannelMode Process::textChannelMode(Channel channel) const
|
||||
{
|
||||
ChannelBuffer *buffer = channel == Channel::Output ? &d->m_stdOut : &d->m_stdErr;
|
||||
return buffer->m_textChannelMode;
|
||||
@@ -1993,7 +1993,7 @@ void QtcProcessPrivate::handleStarted(qint64 processId, qint64 applicationMainTh
|
||||
|
||||
m_processId = processId;
|
||||
m_applicationMainThreadId = applicationMainThreadId;
|
||||
emitGuardedSignal(&QtcProcess::started);
|
||||
emitGuardedSignal(&Process::started);
|
||||
}
|
||||
|
||||
void QtcProcessPrivate::handleReadyRead(const QByteArray &outputData, const QByteArray &errorData)
|
||||
@@ -2011,7 +2011,7 @@ void QtcProcessPrivate::handleReadyRead(const QByteArray &outputData, const QByt
|
||||
std::cout << outputData.constData() << std::flush;
|
||||
} else {
|
||||
m_stdOut.append(outputData);
|
||||
emitGuardedSignal(&QtcProcess::readyReadStandardOutput);
|
||||
emitGuardedSignal(&Process::readyReadStandardOutput);
|
||||
}
|
||||
}
|
||||
if (!errorData.isEmpty()) {
|
||||
@@ -2020,7 +2020,7 @@ void QtcProcessPrivate::handleReadyRead(const QByteArray &outputData, const QByt
|
||||
std::cerr << errorData.constData() << std::flush;
|
||||
} else {
|
||||
m_stdErr.append(errorData);
|
||||
emitGuardedSignal(&QtcProcess::readyReadStandardError);
|
||||
emitGuardedSignal(&Process::readyReadStandardError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2077,7 +2077,7 @@ void QtcProcessPrivate::handleDone(const ProcessResultData &data)
|
||||
m_stdOut.handleRest();
|
||||
m_stdErr.handleRest();
|
||||
|
||||
emitGuardedSignal(&QtcProcess::done);
|
||||
emitGuardedSignal(&Process::done);
|
||||
m_processId = 0;
|
||||
m_applicationMainThreadId = 0;
|
||||
}
|
||||
@@ -2101,7 +2101,7 @@ void QtcProcessPrivate::setupDebugLog()
|
||||
return duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
|
||||
};
|
||||
|
||||
connect(q, &QtcProcess::starting, this, [=] {
|
||||
connect(q, &Process::starting, this, [=] {
|
||||
const quint64 msNow = now();
|
||||
setProperty(QTC_PROCESS_STARTTIME, msNow);
|
||||
|
||||
@@ -2114,7 +2114,7 @@ void QtcProcessPrivate::setupDebugLog()
|
||||
setProperty(QTC_PROCESS_NUMBER, currentNumber);
|
||||
});
|
||||
|
||||
connect(q, &QtcProcess::done, this, [=] {
|
||||
connect(q, &Process::done, this, [=] {
|
||||
if (!m_process.get())
|
||||
return;
|
||||
const QVariant n = property(QTC_PROCESS_NUMBER);
|
||||
@@ -2148,7 +2148,7 @@ void QtcProcessPrivate::storeEventLoopDebugInfo(const QVariant &value)
|
||||
|
||||
ProcessTaskAdapter::ProcessTaskAdapter()
|
||||
{
|
||||
connect(task(), &QtcProcess::done, this, [this] {
|
||||
connect(task(), &Process::done, this, [this] {
|
||||
emit done(task()->result() == ProcessResult::FinishedWithSuccess);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,13 +28,13 @@ class DeviceProcessHooks;
|
||||
class ProcessInterface;
|
||||
class ProcessResultData;
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT QtcProcess final : public QObject
|
||||
class QTCREATOR_UTILS_EXPORT Process final : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QtcProcess(QObject *parent = nullptr);
|
||||
~QtcProcess();
|
||||
explicit Process(QObject *parent = nullptr);
|
||||
~Process();
|
||||
|
||||
// ProcessInterface related
|
||||
|
||||
@@ -194,7 +194,7 @@ signals:
|
||||
void textOnStandardError(const QString &text);
|
||||
|
||||
private:
|
||||
friend QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug str, const QtcProcess &r);
|
||||
friend QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug str, const Process &r);
|
||||
|
||||
friend class Internal::QtcProcessPrivate;
|
||||
Internal::QtcProcessPrivate *d = nullptr;
|
||||
@@ -207,7 +207,7 @@ public:
|
||||
std::function<Environment(const FilePath &)> systemEnvironmentForBinary;
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT ProcessTaskAdapter : public Tasking::TaskAdapter<QtcProcess>
|
||||
class QTCREATOR_UTILS_EXPORT ProcessTaskAdapter : public Tasking::TaskAdapter<Process>
|
||||
{
|
||||
public:
|
||||
ProcessTaskAdapter();
|
||||
|
||||
@@ -45,7 +45,7 @@ class ExternalTerminalProcessImpl final : public TerminalInterface
|
||||
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
m_terminalProcess.setCommand(cmd);
|
||||
QObject::connect(&m_terminalProcess, &QtcProcess::done, this, [this] {
|
||||
QObject::connect(&m_terminalProcess, &Process::done, this, [this] {
|
||||
m_interface->onStubExited();
|
||||
});
|
||||
m_terminalProcess.setCreateConsoleOnWindows(true);
|
||||
@@ -82,7 +82,7 @@ class ExternalTerminalProcessImpl final : public TerminalInterface
|
||||
}
|
||||
|
||||
ExternalTerminalProcessImpl *m_interface;
|
||||
QtcProcess m_terminalProcess;
|
||||
Process m_terminalProcess;
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
@@ -37,7 +37,7 @@ static Q_LOGGING_CATEGORY(avdManagerLog, "qtc.android.avdManager", QtWarningMsg)
|
||||
bool AndroidAvdManager::avdManagerCommand(const AndroidConfig &config, const QStringList &args, QString *output)
|
||||
{
|
||||
CommandLine cmd(config.avdManagerToolPath(), args);
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
Environment env = AndroidConfigurations::toolsEnvironment(config);
|
||||
proc.setEnvironment(env);
|
||||
qCDebug(avdManagerLog).noquote() << "Running AVD Manager command:" << cmd.toUserOutput();
|
||||
@@ -85,7 +85,7 @@ static CreateAvdInfo createAvdCommand(const AndroidConfig &config, const CreateA
|
||||
avdManager.addArg("-f");
|
||||
|
||||
qCDebug(avdManagerLog).noquote() << "Running AVD Manager command:" << avdManager.toUserOutput();
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
proc.setProcessMode(ProcessMode::Writer);
|
||||
proc.setEnvironment(AndroidConfigurations::toolsEnvironment(config));
|
||||
proc.setCommand(avdManager);
|
||||
@@ -146,7 +146,7 @@ bool AndroidAvdManager::removeAvd(const QString &name) const
|
||||
{
|
||||
const CommandLine command(m_config.avdManagerToolPath(), {"delete", "avd", "-n", name});
|
||||
qCDebug(avdManagerLog).noquote() << "Running command (removeAvd):" << command.toUserOutput();
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
proc.setTimeoutS(5);
|
||||
proc.setEnvironment(AndroidConfigurations::toolsEnvironment(m_config));
|
||||
proc.setCommand(command);
|
||||
@@ -232,7 +232,7 @@ static bool is32BitUserSpace()
|
||||
// Do a similar check as android's emulator is doing:
|
||||
if (HostOsInfo::isLinuxHost()) {
|
||||
if (QSysInfo::WordSize == 32) {
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
proc.setTimeoutS(3);
|
||||
proc.setCommand({"getconf", {"LONG_BIT"}});
|
||||
proc.runBlocking();
|
||||
@@ -262,9 +262,9 @@ bool AndroidAvdManager::startAvdAsync(const QString &avdName) const
|
||||
// after the avdProcess has started and before it has finished. Giving a parent object here
|
||||
// should solve the issue. However, AndroidAvdManager is not a QObject, so no clue what parent
|
||||
// would be the most appropriate. Preferably some object taken form android plugin...
|
||||
QtcProcess *avdProcess = new QtcProcess;
|
||||
Process *avdProcess = new Process;
|
||||
avdProcess->setProcessChannelMode(QProcess::MergedChannels);
|
||||
QObject::connect(avdProcess, &QtcProcess::done, avdProcess, [avdProcess] {
|
||||
QObject::connect(avdProcess, &Process::done, avdProcess, [avdProcess] {
|
||||
if (avdProcess->exitCode()) {
|
||||
const QString errorOutput = QString::fromLatin1(avdProcess->readAllRawStandardOutput());
|
||||
QMetaObject::invokeMethod(Core::ICore::mainWindow(), [errorOutput] {
|
||||
@@ -324,7 +324,7 @@ bool AndroidAvdManager::isAvdBooted(const QString &device) const
|
||||
|
||||
const CommandLine command({m_config.adbToolPath(), arguments});
|
||||
qCDebug(avdManagerLog).noquote() << "Running command (isAvdBooted):" << command.toUserOutput();
|
||||
QtcProcess adbProc;
|
||||
Process adbProc;
|
||||
adbProc.setTimeoutS(10);
|
||||
adbProc.setCommand(command);
|
||||
adbProc.runBlocking();
|
||||
|
||||
@@ -1050,7 +1050,7 @@ QAbstractItemModel *AndroidBuildApkStep::keystoreCertificates()
|
||||
const QStringList params = {"-list", "-v", "-keystore", m_keystorePath.toUserOutput(),
|
||||
"-storepass", m_keystorePasswd, "-J-Duser.language=en"};
|
||||
|
||||
QtcProcess keytoolProc;
|
||||
Process keytoolProc;
|
||||
keytoolProc.setTimeoutS(30);
|
||||
keytoolProc.setCommand({AndroidConfigurations::currentConfig().keytoolPath(), params});
|
||||
keytoolProc.runBlocking(EventLoopMode::On);
|
||||
|
||||
@@ -601,7 +601,7 @@ FilePath AndroidConfig::keytoolPath() const
|
||||
QVector<AndroidDeviceInfo> AndroidConfig::connectedDevices(QString *error) const
|
||||
{
|
||||
QVector<AndroidDeviceInfo> devices;
|
||||
QtcProcess adbProc;
|
||||
Process adbProc;
|
||||
adbProc.setTimeoutS(30);
|
||||
CommandLine cmd{adbToolPath(), {"devices"}};
|
||||
adbProc.setCommand(cmd);
|
||||
@@ -670,7 +670,7 @@ QString AndroidConfig::getDeviceProperty(const QString &device, const QString &p
|
||||
AndroidDeviceInfo::adbSelector(device));
|
||||
cmd.addArgs({"shell", "getprop", property});
|
||||
|
||||
QtcProcess adbProc;
|
||||
Process adbProc;
|
||||
adbProc.setTimeoutS(10);
|
||||
adbProc.setCommand(cmd);
|
||||
adbProc.runBlocking();
|
||||
@@ -747,7 +747,7 @@ QStringList AndroidConfig::getAbis(const QString &device)
|
||||
// First try via ro.product.cpu.abilist
|
||||
QStringList arguments = AndroidDeviceInfo::adbSelector(device);
|
||||
arguments << "shell" << "getprop" << "ro.product.cpu.abilist";
|
||||
QtcProcess adbProc;
|
||||
Process adbProc;
|
||||
adbProc.setTimeoutS(10);
|
||||
adbProc.setCommand({adbTool, arguments});
|
||||
adbProc.runBlocking();
|
||||
@@ -770,7 +770,7 @@ QStringList AndroidConfig::getAbis(const QString &device)
|
||||
else
|
||||
arguments << QString::fromLatin1("ro.product.cpu.abi%1").arg(i);
|
||||
|
||||
QtcProcess abiProc;
|
||||
Process abiProc;
|
||||
abiProc.setTimeoutS(10);
|
||||
abiProc.setCommand({adbTool, arguments});
|
||||
abiProc.runBlocking();
|
||||
@@ -1530,7 +1530,7 @@ FilePath AndroidConfig::getJdkPath()
|
||||
args << "-c"
|
||||
<< "readlink -f $(which java)";
|
||||
|
||||
QtcProcess findJdkPathProc;
|
||||
Process findJdkPathProc;
|
||||
findJdkPathProc.setCommand({"sh", args});
|
||||
findJdkPathProc.start();
|
||||
findJdkPathProc.waitForFinished();
|
||||
|
||||
@@ -272,7 +272,7 @@ void AndroidCreateKeystoreCertificate::buttonBoxAccepted()
|
||||
"-keypass", certificatePassword(),
|
||||
"-dname", distinguishedNames});
|
||||
|
||||
QtcProcess genKeyCertProc;
|
||||
Process genKeyCertProc;
|
||||
genKeyCertProc.setTimeoutS(15);
|
||||
genKeyCertProc.setCommand(command);
|
||||
genKeyCertProc.runBlocking(EventLoopMode::On);
|
||||
|
||||
@@ -381,7 +381,7 @@ AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::runDeploy()
|
||||
cmd.addArgs({"install", "-r", m_apkPath.toString()});
|
||||
}
|
||||
|
||||
QtcProcess process;
|
||||
Process process;
|
||||
process.setCommand(cmd);
|
||||
process.setWorkingDirectory(m_workingDirectory);
|
||||
process.setEnvironment(m_environment);
|
||||
@@ -576,7 +576,7 @@ void AndroidDeployQtStep::doCancel()
|
||||
|
||||
void AndroidDeployQtStep::runCommand(const CommandLine &command)
|
||||
{
|
||||
QtcProcess buildProc;
|
||||
Process buildProc;
|
||||
buildProc.setTimeoutS(2 * 60);
|
||||
emit addOutput(Tr::tr("Package deploy: Running command \"%1\".").arg(command.toUserOutput()),
|
||||
OutputFormat::NormalMessage);
|
||||
|
||||
@@ -614,20 +614,20 @@ void AndroidDeviceManager::setupDevicesWatcher()
|
||||
}
|
||||
|
||||
if (!m_adbDeviceWatcherProcess)
|
||||
m_adbDeviceWatcherProcess.reset(new QtcProcess(this));
|
||||
m_adbDeviceWatcherProcess.reset(new Process(this));
|
||||
|
||||
if (m_adbDeviceWatcherProcess->isRunning()) {
|
||||
qCDebug(androidDeviceLog) << "ADB device watcher is already running.";
|
||||
return;
|
||||
}
|
||||
|
||||
connect(m_adbDeviceWatcherProcess.get(), &QtcProcess::done, this, [this] {
|
||||
connect(m_adbDeviceWatcherProcess.get(), &Process::done, this, [this] {
|
||||
if (m_adbDeviceWatcherProcess->error() != QProcess::UnknownError) {
|
||||
qCDebug(androidDeviceLog) << "ADB device watcher encountered an error:"
|
||||
<< m_adbDeviceWatcherProcess->errorString();
|
||||
if (!m_adbDeviceWatcherProcess->isRunning()) {
|
||||
qCDebug(androidDeviceLog) << "Restarting the ADB device watcher now.";
|
||||
QTimer::singleShot(0, m_adbDeviceWatcherProcess.get(), &QtcProcess::start);
|
||||
QTimer::singleShot(0, m_adbDeviceWatcherProcess.get(), &Process::start);
|
||||
}
|
||||
}
|
||||
qCDebug(androidDeviceLog) << "ADB device watcher finished.";
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QSettings>
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
namespace Utils { class Process; }
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
@@ -108,7 +108,7 @@ private:
|
||||
QFutureWatcher<AndroidDeviceInfoList> m_avdsFutureWatcher;
|
||||
QFutureWatcher<QPair<ProjectExplorer::IDevice::ConstPtr, bool>> m_removeAvdFutureWatcher;
|
||||
QFileSystemWatcher m_avdFileSystemWatcher;
|
||||
std::unique_ptr<Utils::QtcProcess> m_adbDeviceWatcherProcess;
|
||||
std::unique_ptr<Utils::Process> m_adbDeviceWatcherProcess;
|
||||
AndroidConfig &m_androidConfig;
|
||||
AndroidAvdManager m_avdManager;
|
||||
|
||||
|
||||
@@ -612,7 +612,7 @@ bool AndroidManager::checkKeystorePassword(const FilePath &keystorePath,
|
||||
const CommandLine cmd(AndroidConfigurations::currentConfig().keytoolPath(),
|
||||
{"-list", "-keystore", keystorePath.toUserOutput(),
|
||||
"--storepass", keystorePasswd});
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
proc.setTimeoutS(10);
|
||||
proc.setCommand(cmd);
|
||||
proc.runBlocking(EventLoopMode::On);
|
||||
@@ -632,7 +632,7 @@ bool AndroidManager::checkCertificatePassword(const FilePath &keystorePath,
|
||||
else
|
||||
arguments << certificatePasswd;
|
||||
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
proc.setTimeoutS(10);
|
||||
proc.setCommand({AndroidConfigurations::currentConfig().keytoolPath(), arguments});
|
||||
proc.runBlocking(EventLoopMode::On);
|
||||
@@ -646,7 +646,7 @@ bool AndroidManager::checkCertificateExists(const FilePath &keystorePath,
|
||||
QStringList arguments = { "-list", "-keystore", keystorePath.toUserOutput(),
|
||||
"--storepass", keystorePasswd, "-alias", alias };
|
||||
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
proc.setTimeoutS(10);
|
||||
proc.setCommand({AndroidConfigurations::currentConfig().keytoolPath(), arguments});
|
||||
proc.runBlocking(EventLoopMode::On);
|
||||
@@ -681,7 +681,7 @@ SdkToolResult AndroidManager::runCommand(const CommandLine &command,
|
||||
const QByteArray &writeData, int timeoutS)
|
||||
{
|
||||
Android::SdkToolResult cmdResult;
|
||||
QtcProcess cmdProc;
|
||||
Process cmdProc;
|
||||
cmdProc.setTimeoutS(timeoutS);
|
||||
cmdProc.setWriteData(writeData);
|
||||
qCDebug(androidManagerLog) << "Running command (sync):" << command.toUserOutput();
|
||||
|
||||
@@ -117,7 +117,7 @@ private:
|
||||
QStringList m_avdAbis;
|
||||
int m_viewerPid = -1;
|
||||
QFutureWatcher<void> m_pidFutureWatcher;
|
||||
Utils::QtcProcess m_logcatProcess;
|
||||
Utils::Process m_logcatProcess;
|
||||
QString m_logcatStartTimeStamp;
|
||||
UploadInfo m_uploadInfo;
|
||||
};
|
||||
@@ -226,7 +226,7 @@ AndroidQmlPreviewWorker::AndroidQmlPreviewWorker(RunControl *runControl)
|
||||
connect(this, &AndroidQmlPreviewWorker::previewPidChanged,
|
||||
this, &AndroidQmlPreviewWorker::startLogcat);
|
||||
|
||||
connect(this, &RunWorker::stopped, &m_logcatProcess, &QtcProcess::stop);
|
||||
connect(this, &RunWorker::stopped, &m_logcatProcess, &Process::stop);
|
||||
m_logcatProcess.setStdOutCallback([this](const QString &stdOut) {
|
||||
filterLogcatAndAppendMessage(stdOut);
|
||||
});
|
||||
@@ -376,7 +376,7 @@ FilePath AndroidQmlPreviewWorker::createQmlrcFile(const FilePath &workFolder,
|
||||
{
|
||||
const QtSupport::QtVersion *qtVersion = QtSupport::QtKitAspect::qtVersion(m_rc->kit());
|
||||
const FilePath rccBinary = qtVersion->rccFilePath();
|
||||
QtcProcess rccProcess;
|
||||
Process rccProcess;
|
||||
FilePath qrcPath = FilePath::fromString(basename + ".qrc4viewer");
|
||||
const FilePath qmlrcPath = FilePath::fromString(QDir::tempPath()) / (basename + packageSuffix);
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ static void findProcessPIDAndUser(QPromise<PidUserPair> &promise,
|
||||
chrono::high_resolution_clock::time_point start = chrono::high_resolution_clock::now();
|
||||
do {
|
||||
QThread::msleep(200);
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
proc.setCommand({adbPath, args});
|
||||
proc.runBlocking();
|
||||
const QString out = proc.allOutput();
|
||||
@@ -117,7 +117,7 @@ static void findProcessPIDAndUser(QPromise<PidUserPair> &promise,
|
||||
args = {selector};
|
||||
args.append({"shell", "ps", "-o", "user", "-p"});
|
||||
args.append(QString::number(processPID));
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
proc.setCommand({adbPath, args});
|
||||
proc.runBlocking();
|
||||
const QString out = proc.allOutput();
|
||||
|
||||
@@ -93,7 +93,7 @@ static bool sdkManagerCommand(const AndroidConfig &config, const QStringList &ar
|
||||
qCDebug(sdkManagerLog).noquote() << "Running SDK Manager command (sync):"
|
||||
<< CommandLine(config.sdkManagerToolPath(), newArgs)
|
||||
.toUserOutput();
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
proc.setEnvironment(AndroidConfigurations::toolsEnvironment(config));
|
||||
proc.setTimeoutS(timeout);
|
||||
proc.setTimeOutMessageBoxEnabled(true);
|
||||
@@ -121,7 +121,7 @@ static void sdkManagerCommand(const AndroidConfig &config, const QStringList &ar
|
||||
<< CommandLine(config.sdkManagerToolPath(), newArgs)
|
||||
.toUserOutput();
|
||||
int offset = promise.future().progressValue();
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
proc.setEnvironment(AndroidConfigurations::toolsEnvironment(config));
|
||||
bool assertionFound = false;
|
||||
proc.setTimeoutS(timeout);
|
||||
@@ -521,7 +521,7 @@ void AndroidSdkManagerPrivate::getPendingLicense(SdkCmdPromise &fi)
|
||||
AndroidSdkManager::OperationOutput result;
|
||||
result.type = AndroidSdkManager::LicenseWorkflow;
|
||||
|
||||
QtcProcess licenseCommand;
|
||||
Process licenseCommand;
|
||||
licenseCommand.setProcessMode(ProcessMode::Writer);
|
||||
licenseCommand.setEnvironment(AndroidConfigurations::toolsEnvironment(m_config));
|
||||
bool reviewingLicenses = false;
|
||||
|
||||
@@ -659,7 +659,7 @@ void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent)
|
||||
openSslProgressDialog->setFixedSize(openSslProgressDialog->sizeHint());
|
||||
|
||||
const QString openSslRepo("https://github.com/KDAB/android_openssl.git");
|
||||
QtcProcess *gitCloner = new QtcProcess(this);
|
||||
Process *gitCloner = new Process(this);
|
||||
CommandLine gitCloneCommand("git", {"clone", "--depth=1", openSslRepo, openSslPath.toString()});
|
||||
gitCloner->setCommand(gitCloneCommand);
|
||||
|
||||
@@ -684,7 +684,7 @@ void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent)
|
||||
openButton->deleteLater();
|
||||
};
|
||||
|
||||
connect(gitCloner, &QtcProcess::done, this, [=] {
|
||||
connect(gitCloner, &Process::done, this, [=] {
|
||||
openSslProgressDialog->close();
|
||||
if (gitCloner->error() != QProcess::UnknownError) {
|
||||
if (gitCloner->error() == QProcess::FailedToStart) {
|
||||
|
||||
@@ -90,8 +90,8 @@ void AndroidSignalOperation::startAdbProcess(State state, const Utils::CommandLi
|
||||
{
|
||||
m_state = state;
|
||||
m_timeout->start();
|
||||
m_adbProcess.reset(new QtcProcess);
|
||||
connect(m_adbProcess.get(), &QtcProcess::done, this, handler);
|
||||
m_adbProcess.reset(new Process);
|
||||
connect(m_adbProcess.get(), &Process::done, this, handler);
|
||||
m_adbProcess->setCommand(commandLine);
|
||||
m_adbProcess->start();
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ private:
|
||||
void startAdbProcess(State state, const Utils::CommandLine &commandLine, FinishHandler handler);
|
||||
|
||||
Utils::FilePath m_adbPath;
|
||||
std::unique_ptr<Utils::QtcProcess> m_adbProcess;
|
||||
std::unique_ptr<Utils::Process> m_adbProcess;
|
||||
QTimer *m_timeout;
|
||||
|
||||
State m_state = Idle;
|
||||
|
||||
@@ -17,7 +17,7 @@ using namespace Utils;
|
||||
namespace Autotest {
|
||||
namespace Internal {
|
||||
|
||||
TestOutputReader *BoostTestConfiguration::createOutputReader(QtcProcess *app) const
|
||||
TestOutputReader *BoostTestConfiguration::createOutputReader(Process *app) const
|
||||
{
|
||||
auto settings = static_cast<BoostTestSettings *>(framework()->testSettings());
|
||||
return new BoostTestOutputReader(app, buildDirectory(), projectFile(),
|
||||
|
||||
@@ -13,7 +13,7 @@ class BoostTestConfiguration : public DebuggableTestConfiguration
|
||||
public:
|
||||
explicit BoostTestConfiguration(ITestFramework *framework)
|
||||
: DebuggableTestConfiguration(framework) {}
|
||||
TestOutputReader *createOutputReader(Utils::QtcProcess *app) const override;
|
||||
TestOutputReader *createOutputReader(Utils::Process *app) const override;
|
||||
QStringList argumentsForTestRunner(QStringList *omitted = nullptr) const override;
|
||||
Utils::Environment filteredEnvironment(const Utils::Environment &original) const override;
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Internal {
|
||||
|
||||
static Q_LOGGING_CATEGORY(orLog, "qtc.autotest.boost.outputreader", QtWarningMsg)
|
||||
|
||||
BoostTestOutputReader::BoostTestOutputReader(QtcProcess *testApplication,
|
||||
BoostTestOutputReader::BoostTestOutputReader(Process *testApplication,
|
||||
const FilePath &buildDirectory,
|
||||
const FilePath &projectFile,
|
||||
LogLevel log, ReportLevel report)
|
||||
@@ -34,7 +34,7 @@ BoostTestOutputReader::BoostTestOutputReader(QtcProcess *testApplication,
|
||||
if (!testApplication)
|
||||
return;
|
||||
|
||||
connect(testApplication, &QtcProcess::done, this, [this, testApplication] {
|
||||
connect(testApplication, &Process::done, this, [this, testApplication] {
|
||||
onDone(testApplication->exitCode());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class BoostTestOutputReader : public TestOutputReader
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BoostTestOutputReader(Utils::QtcProcess *testApplication, const Utils::FilePath &buildDirectory,
|
||||
BoostTestOutputReader(Utils::Process *testApplication, const Utils::FilePath &buildDirectory,
|
||||
const Utils::FilePath &projectFile, LogLevel log, ReportLevel report);
|
||||
protected:
|
||||
void processOutputLine(const QByteArray &outputLine) override;
|
||||
|
||||
@@ -15,7 +15,7 @@ using namespace Utils;
|
||||
namespace Autotest {
|
||||
namespace Internal {
|
||||
|
||||
TestOutputReader *CatchConfiguration::createOutputReader(QtcProcess *app) const
|
||||
TestOutputReader *CatchConfiguration::createOutputReader(Process *app) const
|
||||
{
|
||||
return new CatchOutputReader(app, buildDirectory(), projectFile());
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class CatchConfiguration : public DebuggableTestConfiguration
|
||||
{
|
||||
public:
|
||||
CatchConfiguration(ITestFramework *framework) : DebuggableTestConfiguration(framework) {}
|
||||
TestOutputReader *createOutputReader(Utils::QtcProcess *app) const override;
|
||||
TestOutputReader *createOutputReader(Utils::Process *app) const override;
|
||||
QStringList argumentsForTestRunner(QStringList *omitted = nullptr) const override;
|
||||
Utils::Environment filteredEnvironment(const Utils::Environment &original) const override;
|
||||
};
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace CatchXml {
|
||||
const char TestCaseResultElement[] = "OverallResult";
|
||||
}
|
||||
|
||||
CatchOutputReader::CatchOutputReader(QtcProcess *testApplication,
|
||||
CatchOutputReader::CatchOutputReader(Process *testApplication,
|
||||
const FilePath &buildDirectory,
|
||||
const FilePath &projectFile)
|
||||
: TestOutputReader(testApplication, buildDirectory)
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Internal {
|
||||
class CatchOutputReader : public TestOutputReader
|
||||
{
|
||||
public:
|
||||
CatchOutputReader(Utils::QtcProcess *testApplication, const Utils::FilePath &buildDirectory,
|
||||
CatchOutputReader(Utils::Process *testApplication, const Utils::FilePath &buildDirectory,
|
||||
const Utils::FilePath &projectFile);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -13,7 +13,7 @@ CTestConfiguration::CTestConfiguration(ITestBase *testBase)
|
||||
setDisplayName("CTest");
|
||||
}
|
||||
|
||||
TestOutputReader *CTestConfiguration::createOutputReader(Utils::QtcProcess *app) const
|
||||
TestOutputReader *CTestConfiguration::createOutputReader(Utils::Process *app) const
|
||||
{
|
||||
return new CTestOutputReader(app, workingDirectory());
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class CTestConfiguration final : public Autotest::TestToolConfiguration
|
||||
public:
|
||||
explicit CTestConfiguration(ITestBase *testBase);
|
||||
|
||||
TestOutputReader *createOutputReader(Utils::QtcProcess *app) const final;
|
||||
TestOutputReader *createOutputReader(Utils::Process *app) const final;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
{}
|
||||
};
|
||||
|
||||
CTestOutputReader::CTestOutputReader(QtcProcess *testApplication,
|
||||
CTestOutputReader::CTestOutputReader(Process *testApplication,
|
||||
const FilePath &buildDirectory)
|
||||
: TestOutputReader(testApplication, buildDirectory)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "../testoutputreader.h"
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
namespace Utils { class Process; }
|
||||
|
||||
namespace Autotest {
|
||||
namespace Internal {
|
||||
@@ -13,7 +13,7 @@ namespace Internal {
|
||||
class CTestOutputReader final : public Autotest::TestOutputReader
|
||||
{
|
||||
public:
|
||||
CTestOutputReader(Utils::QtcProcess *testApplication, const Utils::FilePath &buildDirectory);
|
||||
CTestOutputReader(Utils::Process *testApplication, const Utils::FilePath &buildDirectory);
|
||||
|
||||
protected:
|
||||
void processOutputLine(const QByteArray &outputLineWithNewLine) final;
|
||||
|
||||
@@ -17,7 +17,7 @@ using namespace Utils;
|
||||
namespace Autotest {
|
||||
namespace Internal {
|
||||
|
||||
TestOutputReader *GTestConfiguration::createOutputReader(QtcProcess *app) const
|
||||
TestOutputReader *GTestConfiguration::createOutputReader(Process *app) const
|
||||
{
|
||||
return new GTestOutputReader(app, buildDirectory(), projectFile());
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
explicit GTestConfiguration(ITestFramework *framework)
|
||||
: DebuggableTestConfiguration(framework) {}
|
||||
|
||||
TestOutputReader *createOutputReader(Utils::QtcProcess *app) const override;
|
||||
TestOutputReader *createOutputReader(Utils::Process *app) const override;
|
||||
QStringList argumentsForTestRunner(QStringList *omitted = nullptr) const override;
|
||||
Utils::Environment filteredEnvironment(const Utils::Environment &original) const override;
|
||||
};
|
||||
|
||||
@@ -17,14 +17,14 @@ using namespace Utils;
|
||||
namespace Autotest {
|
||||
namespace Internal {
|
||||
|
||||
GTestOutputReader::GTestOutputReader(QtcProcess *testApplication,
|
||||
GTestOutputReader::GTestOutputReader(Process *testApplication,
|
||||
const FilePath &buildDirectory,
|
||||
const FilePath &projectFile)
|
||||
: TestOutputReader(testApplication, buildDirectory)
|
||||
, m_projectFile(projectFile)
|
||||
{
|
||||
if (testApplication) {
|
||||
connect(testApplication, &QtcProcess::done, this, [this, testApplication] {
|
||||
connect(testApplication, &Process::done, this, [this, testApplication] {
|
||||
const int exitCode = testApplication->exitCode();
|
||||
if (exitCode == 1 && !m_description.isEmpty()) {
|
||||
createAndReportResult(Tr::tr("Running tests failed.\n %1\nExecutable: %2")
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Internal {
|
||||
class GTestOutputReader : public TestOutputReader
|
||||
{
|
||||
public:
|
||||
GTestOutputReader(Utils::QtcProcess *testApplication, const Utils::FilePath &buildDirectory,
|
||||
GTestOutputReader(Utils::Process *testApplication, const Utils::FilePath &buildDirectory,
|
||||
const Utils::FilePath &projectFile);
|
||||
protected:
|
||||
void processOutputLine(const QByteArray &outputLine) override;
|
||||
|
||||
@@ -28,7 +28,7 @@ static QStringList quoteIfNeeded(const QStringList &testCases, bool debugMode)
|
||||
});
|
||||
}
|
||||
|
||||
TestOutputReader *QtTestConfiguration::createOutputReader(QtcProcess *app) const
|
||||
TestOutputReader *QtTestConfiguration::createOutputReader(Process *app) const
|
||||
{
|
||||
auto qtSettings = static_cast<QtTestSettings *>(framework()->testSettings());
|
||||
const QtTestOutputReader::OutputMode mode = qtSettings && qtSettings->useXMLOutput.value()
|
||||
|
||||
@@ -13,7 +13,7 @@ class QtTestConfiguration : public DebuggableTestConfiguration
|
||||
public:
|
||||
explicit QtTestConfiguration(ITestFramework *framework)
|
||||
: DebuggableTestConfiguration(framework) {}
|
||||
TestOutputReader *createOutputReader(Utils::QtcProcess *app) const override;
|
||||
TestOutputReader *createOutputReader(Utils::Process *app) const override;
|
||||
QStringList argumentsForTestRunner(QStringList *omitted = nullptr) const override;
|
||||
Utils::Environment filteredEnvironment(const Utils::Environment &original) const override;
|
||||
};
|
||||
|
||||
@@ -101,7 +101,7 @@ static QString constructBenchmarkInformation(const QString &metric, double value
|
||||
.arg(iterations);
|
||||
}
|
||||
|
||||
QtTestOutputReader::QtTestOutputReader(QtcProcess *testApplication,
|
||||
QtTestOutputReader::QtTestOutputReader(Process *testApplication,
|
||||
const FilePath &buildDirectory,
|
||||
const FilePath &projectFile,
|
||||
OutputMode mode, TestType type)
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
PlainText
|
||||
};
|
||||
|
||||
QtTestOutputReader(Utils::QtcProcess *testApplication, const Utils::FilePath &buildDirectory,
|
||||
QtTestOutputReader(Utils::Process *testApplication, const Utils::FilePath &buildDirectory,
|
||||
const Utils::FilePath &projectFile, OutputMode mode, TestType type);
|
||||
protected:
|
||||
void processOutputLine(const QByteArray &outputLine) override;
|
||||
|
||||
@@ -21,7 +21,7 @@ QuickTestConfiguration::QuickTestConfiguration(ITestFramework *framework)
|
||||
setMixedDebugging(true);
|
||||
}
|
||||
|
||||
TestOutputReader *QuickTestConfiguration::createOutputReader(QtcProcess *app) const
|
||||
TestOutputReader *QuickTestConfiguration::createOutputReader(Process *app) const
|
||||
{
|
||||
auto qtSettings = static_cast<QtTestSettings *>(framework()->testSettings());
|
||||
const QtTestOutputReader::OutputMode mode = qtSettings && qtSettings->useXMLOutput.value()
|
||||
|
||||
@@ -12,7 +12,7 @@ class QuickTestConfiguration : public DebuggableTestConfiguration
|
||||
{
|
||||
public:
|
||||
explicit QuickTestConfiguration(ITestFramework *framework);
|
||||
TestOutputReader *createOutputReader(Utils::QtcProcess *app) const override;
|
||||
TestOutputReader *createOutputReader(Utils::Process *app) const override;
|
||||
QStringList argumentsForTestRunner(QStringList *omitted = nullptr) const override;
|
||||
Utils::Environment filteredEnvironment(const Utils::Environment &original) const override;
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <QPointer>
|
||||
#include <QStringList>
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
namespace Utils { class Process; }
|
||||
|
||||
namespace Autotest {
|
||||
namespace Internal {
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
Utils::FilePath executableFilePath() const;
|
||||
virtual Utils::FilePath testExecutable() const { return executableFilePath(); };
|
||||
|
||||
virtual TestOutputReader *createOutputReader(Utils::QtcProcess *app) const = 0;
|
||||
virtual TestOutputReader *createOutputReader(Utils::Process *app) const = 0;
|
||||
virtual Utils::Environment filteredEnvironment(const Utils::Environment &original) const;
|
||||
|
||||
ITestBase *testBase() const { return m_testBase; }
|
||||
|
||||
@@ -21,7 +21,7 @@ FilePath TestOutputReader::constructSourceFilePath(const FilePath &path, const Q
|
||||
return filePath.isReadableFile() ? filePath : FilePath();
|
||||
}
|
||||
|
||||
TestOutputReader::TestOutputReader(QtcProcess *testApplication, const FilePath &buildDirectory)
|
||||
TestOutputReader::TestOutputReader(Process *testApplication, const FilePath &buildDirectory)
|
||||
: m_buildDir(buildDirectory)
|
||||
{
|
||||
auto chopLineBreak = [](QByteArray line) {
|
||||
@@ -33,7 +33,7 @@ TestOutputReader::TestOutputReader(QtcProcess *testApplication, const FilePath &
|
||||
};
|
||||
|
||||
if (testApplication) {
|
||||
connect(testApplication, &QtcProcess::started, this, [this, testApplication] {
|
||||
connect(testApplication, &Process::started, this, [this, testApplication] {
|
||||
m_id = testApplication->commandLine().executable().toUserOutput();
|
||||
});
|
||||
testApplication->setStdOutLineCallback([this, &chopLineBreak](const QString &line) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
namespace Utils { class Process; }
|
||||
|
||||
namespace Autotest {
|
||||
|
||||
@@ -15,7 +15,7 @@ class TestOutputReader : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TestOutputReader(Utils::QtcProcess *testApplication, const Utils::FilePath &buildDirectory);
|
||||
TestOutputReader(Utils::Process *testApplication, const Utils::FilePath &buildDirectory);
|
||||
virtual ~TestOutputReader();
|
||||
void processStdOutput(const QByteArray &outputLine);
|
||||
virtual void processStdError(const QByteArray &outputLine);
|
||||
|
||||
@@ -89,7 +89,7 @@ void TestRunner::runTest(TestRunMode mode, const ITestTreeItem *item)
|
||||
runTests(mode, {configuration});
|
||||
}
|
||||
|
||||
static QString processInformation(const QtcProcess *proc)
|
||||
static QString processInformation(const Process *proc)
|
||||
{
|
||||
QTC_ASSERT(proc, return {});
|
||||
const CommandLine command = proc->commandLine();
|
||||
@@ -365,7 +365,7 @@ void TestRunner::runTestsHelper()
|
||||
}
|
||||
return TaskAction::Continue;
|
||||
};
|
||||
const auto onSetup = [this, config, storage](QtcProcess &process) {
|
||||
const auto onSetup = [this, config, storage](Process &process) {
|
||||
TestStorage *testStorage = storage.activeStorage();
|
||||
QTC_ASSERT(testStorage, return);
|
||||
testStorage->m_outputReader.reset(config->createOutputReader(&process));
|
||||
@@ -412,7 +412,7 @@ void TestRunner::runTestsHelper()
|
||||
qCInfo(runnerLog) << "Working directory:" << process.workingDirectory();
|
||||
qCDebug(runnerLog) << "Environment:" << process.environment().toStringList();
|
||||
};
|
||||
const auto onDone = [this, config, storage](const QtcProcess &process) {
|
||||
const auto onDone = [this, config, storage](const Process &process) {
|
||||
TestStorage *testStorage = storage.activeStorage();
|
||||
QTC_ASSERT(testStorage, return);
|
||||
if (process.result() == ProcessResult::StartFailed) {
|
||||
|
||||
@@ -358,12 +358,12 @@ UvscServerProviderRunner::UvscServerProviderRunner(ProjectExplorer::RunControl *
|
||||
|
||||
m_process.setCommand(runnable.command);
|
||||
|
||||
connect(&m_process, &QtcProcess::started, this, [this] {
|
||||
connect(&m_process, &Process::started, this, [this] {
|
||||
ProcessHandle pid(m_process.processId());
|
||||
this->runControl()->setApplicationProcessHandle(pid);
|
||||
reportStarted();
|
||||
});
|
||||
connect(&m_process, &QtcProcess::done, this, [this] {
|
||||
connect(&m_process, &Process::done, this, [this] {
|
||||
appendMessage(m_process.exitMessage(), NormalMessageFormat);
|
||||
reportStopped();
|
||||
});
|
||||
|
||||
@@ -127,7 +127,7 @@ private:
|
||||
void start() final;
|
||||
void stop() final;
|
||||
|
||||
Utils::QtcProcess m_process;
|
||||
Utils::Process m_process;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -78,7 +78,7 @@ static Macros dumpPredefinedMacros(const FilePath &compiler, const QStringList &
|
||||
|
||||
const QString outpath = fakeIn.fileName() + ".tmp";
|
||||
|
||||
QtcProcess cpp;
|
||||
Process cpp;
|
||||
cpp.setEnvironment(env);
|
||||
cpp.setTimeoutS(10);
|
||||
|
||||
@@ -130,7 +130,7 @@ static HeaderPaths dumpHeaderPaths(const FilePath &compiler, const Id languageId
|
||||
cmd.addArg("--preinclude");
|
||||
cmd.addArg(".");
|
||||
|
||||
QtcProcess cpp;
|
||||
Process cpp;
|
||||
cpp.setEnvironment(env);
|
||||
cpp.setTimeoutS(10);
|
||||
cpp.setCommand(cmd);
|
||||
|
||||
@@ -113,7 +113,7 @@ static Macros dumpMcsPredefinedMacros(const FilePath &compiler, const Environmen
|
||||
|
||||
fakeIn.close();
|
||||
|
||||
QtcProcess cpp;
|
||||
Process cpp;
|
||||
cpp.setEnvironment(env);
|
||||
cpp.setTimeoutS(10);
|
||||
cpp.setCommand({compiler, {fakeIn.fileName()}});
|
||||
@@ -190,7 +190,7 @@ static Macros dumpC166PredefinedMacros(const FilePath &compiler, const Environme
|
||||
|
||||
fakeIn.close();
|
||||
|
||||
QtcProcess cpp;
|
||||
Process cpp;
|
||||
cpp.setEnvironment(env);
|
||||
cpp.setTimeoutS(10);
|
||||
|
||||
@@ -255,7 +255,7 @@ static Macros dumpC166PredefinedMacros(const FilePath &compiler, const Environme
|
||||
|
||||
static Macros dumpArmPredefinedMacros(const FilePath &compiler, const QStringList &extraArgs, const Environment &env)
|
||||
{
|
||||
QtcProcess cpp;
|
||||
Process cpp;
|
||||
cpp.setEnvironment(env);
|
||||
cpp.setTimeoutS(10);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ static Macros dumpPredefinedMacros(const FilePath &compiler, const Environment &
|
||||
return {};
|
||||
fakeIn.close();
|
||||
|
||||
QtcProcess cpp;
|
||||
Process cpp;
|
||||
cpp.setEnvironment(env);
|
||||
cpp.setTimeoutS(10);
|
||||
cpp.setCommand({compiler, {compilerTargetFlag(abi), "-dM", "-E", fakeIn.fileName()}});
|
||||
@@ -86,7 +86,7 @@ static HeaderPaths dumpHeaderPaths(const FilePath &compiler, const Environment &
|
||||
if (!compiler.exists())
|
||||
return {};
|
||||
|
||||
QtcProcess cpp;
|
||||
Process cpp;
|
||||
cpp.setEnvironment(env);
|
||||
cpp.setTimeoutS(10);
|
||||
cpp.setCommand({compiler, {compilerTargetFlag(abi), "--print-search-dirs"}});
|
||||
|
||||
@@ -34,7 +34,7 @@ class VersionUpdater
|
||||
public:
|
||||
VersionUpdater()
|
||||
{
|
||||
QObject::connect(&m_process, &QtcProcess::done, &m_process, [this] {
|
||||
QObject::connect(&m_process, &Process::done, &m_process, [this] {
|
||||
if (m_process.result() != ProcessResult::FinishedWithSuccess)
|
||||
return;
|
||||
|
||||
@@ -77,7 +77,7 @@ private:
|
||||
}
|
||||
|
||||
QRegularExpression m_versionRegExp;
|
||||
mutable QtcProcess m_process;
|
||||
mutable Process m_process;
|
||||
QVersionNumber m_versionNumber;
|
||||
};
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ QString ArtisticStyleSettings::documentationFilePath() const
|
||||
|
||||
void ArtisticStyleSettings::createDocumentationFile() const
|
||||
{
|
||||
QtcProcess process;
|
||||
Process process;
|
||||
process.setTimeoutS(2);
|
||||
process.setCommand({command(), {"-h"}});
|
||||
process.runBlocking();
|
||||
|
||||
@@ -124,7 +124,7 @@ QString UncrustifySettings::documentationFilePath() const
|
||||
|
||||
void UncrustifySettings::createDocumentationFile() const
|
||||
{
|
||||
QtcProcess process;
|
||||
Process process;
|
||||
process.setTimeoutS(2);
|
||||
process.setCommand({command(), {"--show-config"}});
|
||||
process.runBlocking();
|
||||
|
||||
@@ -118,7 +118,7 @@ void QdbWatcher::forkHostServer()
|
||||
showMessage(message, true);
|
||||
return;
|
||||
}
|
||||
if (Utils::QtcProcess::startDetached({qdbFilePath, {"server"}}))
|
||||
if (Utils::Process::startDetached({qdbFilePath, {"server"}}))
|
||||
showMessage(Tr::tr("QDB host server started."), false);
|
||||
else
|
||||
showMessage(Tr::tr("Could not start QDB host server in %1").arg(qdbFilePath.toString()), true);
|
||||
|
||||
@@ -50,7 +50,7 @@ class DeviceApplicationObserver : public QObject
|
||||
public:
|
||||
DeviceApplicationObserver(const IDevice::ConstPtr &device, const CommandLine &command)
|
||||
{
|
||||
connect(&m_appRunner, &QtcProcess::done, this, &DeviceApplicationObserver::handleDone);
|
||||
connect(&m_appRunner, &Process::done, this, &DeviceApplicationObserver::handleDone);
|
||||
|
||||
QTC_ASSERT(device, return);
|
||||
m_deviceName = device->displayName();
|
||||
@@ -94,7 +94,7 @@ private:
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
QtcProcess m_appRunner;
|
||||
Process m_appRunner;
|
||||
QString m_deviceName;
|
||||
};
|
||||
|
||||
|
||||
@@ -34,13 +34,13 @@ public:
|
||||
{
|
||||
setId("QdbDebuggeeRunner");
|
||||
|
||||
connect(&m_launcher, &QtcProcess::started, this, &RunWorker::reportStarted);
|
||||
connect(&m_launcher, &QtcProcess::done, this, &RunWorker::reportStopped);
|
||||
connect(&m_launcher, &Process::started, this, &RunWorker::reportStarted);
|
||||
connect(&m_launcher, &Process::done, this, &RunWorker::reportStopped);
|
||||
|
||||
connect(&m_launcher, &QtcProcess::readyReadStandardOutput, this, [this] {
|
||||
connect(&m_launcher, &Process::readyReadStandardOutput, this, [this] {
|
||||
appendMessage(m_launcher.readAllStandardOutput(), StdOutFormat);
|
||||
});
|
||||
connect(&m_launcher, &QtcProcess::readyReadStandardError, this, [this] {
|
||||
connect(&m_launcher, &Process::readyReadStandardError, this, [this] {
|
||||
appendMessage(m_launcher.readAllStandardError(), StdErrFormat);
|
||||
});
|
||||
|
||||
@@ -112,7 +112,7 @@ private:
|
||||
bool m_useGdbServer;
|
||||
bool m_useQmlServer;
|
||||
QmlDebug::QmlDebugServicesPreset m_qmlServices;
|
||||
QtcProcess m_launcher;
|
||||
Process m_launcher;
|
||||
};
|
||||
|
||||
// QdbDeviceRunSupport
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
private:
|
||||
Group deployRecipe() final
|
||||
{
|
||||
const auto setupHandler = [this](QtcProcess &process) {
|
||||
const auto setupHandler = [this](Process &process) {
|
||||
QString remoteExe;
|
||||
if (RunConfiguration *rc = target()->activeRunConfiguration()) {
|
||||
if (auto exeAspect = rc->aspect<ExecutableAspect>())
|
||||
@@ -54,18 +54,18 @@ private:
|
||||
else
|
||||
cmd.addArg("--remove-default");
|
||||
process.setCommand(cmd);
|
||||
QtcProcess *proc = &process;
|
||||
connect(proc, &QtcProcess::readyReadStandardError, this, [this, proc] {
|
||||
Process *proc = &process;
|
||||
connect(proc, &Process::readyReadStandardError, this, [this, proc] {
|
||||
handleStdErrData(proc->readAllStandardError());
|
||||
});
|
||||
};
|
||||
const auto doneHandler = [this](const QtcProcess &) {
|
||||
const auto doneHandler = [this](const Process &) {
|
||||
if (m_makeDefault)
|
||||
addProgressMessage(Tr::tr("Application set as the default one."));
|
||||
else
|
||||
addProgressMessage(Tr::tr("Reset the default application."));
|
||||
};
|
||||
const auto errorHandler = [this](const QtcProcess &process) {
|
||||
const auto errorHandler = [this](const Process &process) {
|
||||
addErrorMessage(Tr::tr("Remote process failed: %1").arg(process.errorString()));
|
||||
};
|
||||
return Group { ProcessTask(setupHandler, doneHandler, errorHandler) };
|
||||
|
||||
@@ -49,9 +49,9 @@ static void startFlashingWizard()
|
||||
{
|
||||
const FilePath filePath = flashWizardFilePath();
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
if (QtcProcess::startDetached({"explorer.exe", {filePath.toUserOutput()}}))
|
||||
if (Process::startDetached({"explorer.exe", {filePath.toUserOutput()}}))
|
||||
return;
|
||||
} else if (QtcProcess::startDetached({filePath, {}})) {
|
||||
} else if (Process::startDetached({filePath, {}})) {
|
||||
return;
|
||||
}
|
||||
const QString message = Tr::tr("Flash wizard \"%1\" failed to start.");
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
|
||||
Group QdbStopApplicationStep::deployRecipe()
|
||||
{
|
||||
const auto setupHandler = [this](QtcProcess &process) {
|
||||
const auto setupHandler = [this](Process &process) {
|
||||
const auto device = DeviceKitAspect::device(target()->kit());
|
||||
if (!device) {
|
||||
addErrorMessage(Tr::tr("No device to stop the application on."));
|
||||
@@ -48,16 +48,16 @@ Group QdbStopApplicationStep::deployRecipe()
|
||||
QTC_CHECK(device);
|
||||
process.setCommand({device->filePath(Constants::AppcontrollerFilepath), {"--stop"}});
|
||||
process.setWorkingDirectory("/usr/bin");
|
||||
QtcProcess *proc = &process;
|
||||
connect(proc, &QtcProcess::readyReadStandardOutput, this, [this, proc] {
|
||||
Process *proc = &process;
|
||||
connect(proc, &Process::readyReadStandardOutput, this, [this, proc] {
|
||||
handleStdOutData(proc->readAllStandardOutput());
|
||||
});
|
||||
return TaskAction::Continue;
|
||||
};
|
||||
const auto doneHandler = [this](const QtcProcess &) {
|
||||
const auto doneHandler = [this](const Process &) {
|
||||
addProgressMessage(Tr::tr("Stopped the running application."));
|
||||
};
|
||||
const auto errorHandler = [this](const QtcProcess &process) {
|
||||
const auto errorHandler = [this](const Process &process) {
|
||||
const QString errorOutput = process.cleanedStdErr();
|
||||
const QString failureMessage = Tr::tr("Could not check and possibly stop running application.");
|
||||
if (process.exitStatus() == QProcess::CrashExit) {
|
||||
|
||||
@@ -141,7 +141,7 @@ TaskItem clangToolTask(const AnalyzeInputData &input,
|
||||
|
||||
return TaskAction::Continue;
|
||||
};
|
||||
const auto onProcessSetup = [=](QtcProcess &process) {
|
||||
const auto onProcessSetup = [=](Process &process) {
|
||||
process.setEnvironment(input.environment);
|
||||
process.setUseCtrlCStub(true);
|
||||
process.setLowPriority();
|
||||
@@ -158,13 +158,13 @@ TaskItem clangToolTask(const AnalyzeInputData &input,
|
||||
qCDebug(LOG).noquote() << "Starting" << commandLine.toUserOutput();
|
||||
process.setCommand(commandLine);
|
||||
};
|
||||
const auto onProcessDone = [=](const QtcProcess &process) {
|
||||
const auto onProcessDone = [=](const Process &process) {
|
||||
qCDebug(LOG).noquote() << "Output:\n" << process.cleanedStdOut();
|
||||
if (!outputHandler)
|
||||
return;
|
||||
outputHandler({true, input.unit.file, storage->outputFilePath, input.tool});
|
||||
};
|
||||
const auto onProcessError = [=](const QtcProcess &process) {
|
||||
const auto onProcessError = [=](const Process &process) {
|
||||
if (!outputHandler)
|
||||
return;
|
||||
const QString details = Tr::tr("Command line: %1\nProcess Error: %2\nOutput:\n%3")
|
||||
|
||||
@@ -211,7 +211,7 @@ bool isVFSOverlaySupported(const FilePath &executable)
|
||||
static QMap<FilePath, bool> vfsCapabilities;
|
||||
auto it = vfsCapabilities.find(executable);
|
||||
if (it == vfsCapabilities.end()) {
|
||||
QtcProcess p;
|
||||
Process p;
|
||||
p.setCommand({executable, {"--help"}});
|
||||
p.runBlocking();
|
||||
it = vfsCapabilities.insert(executable, p.allOutput().contains("vfsoverlay"));
|
||||
|
||||
@@ -26,7 +26,7 @@ static QString runExecutable(const Utils::CommandLine &commandLine, QueryFailMod
|
||||
if (commandLine.executable().isEmpty() || !commandLine.executable().toFileInfo().isExecutable())
|
||||
return {};
|
||||
|
||||
QtcProcess cpp;
|
||||
Process cpp;
|
||||
Environment env = Environment::systemEnvironment();
|
||||
env.setupEnglishOutput();
|
||||
cpp.setEnvironment(env);
|
||||
|
||||
@@ -1575,7 +1575,7 @@ CommandResult ClearCasePluginPrivate::runCleartoolProc(const FilePath &workingDi
|
||||
if (m_settings.ccBinaryPath.isEmpty())
|
||||
return CommandResult(ProcessResult::StartFailed, Tr::tr("No ClearCase executable specified."));
|
||||
|
||||
QtcProcess process;
|
||||
Process process;
|
||||
Environment env = Environment::systemEnvironment();
|
||||
VcsBase::setProcessEnvironment(&env);
|
||||
process.setEnvironment(env);
|
||||
@@ -2233,7 +2233,7 @@ void ClearCasePluginPrivate::diffGraphical(const QString &file1, const QString &
|
||||
args << file1;
|
||||
if (!pred)
|
||||
args << file2;
|
||||
QtcProcess::startDetached({m_settings.ccBinaryPath, args}, m_topLevel);
|
||||
Process::startDetached({m_settings.ccBinaryPath, args}, m_topLevel);
|
||||
}
|
||||
|
||||
QString ClearCasePluginPrivate::runExtDiff(const FilePath &workingDir, const QStringList &arguments,
|
||||
@@ -2243,7 +2243,7 @@ QString ClearCasePluginPrivate::runExtDiff(const FilePath &workingDir, const QSt
|
||||
diff.addArgs(m_settings.diffArgs.split(' ', Qt::SkipEmptyParts));
|
||||
diff.addArgs(arguments);
|
||||
|
||||
QtcProcess process;
|
||||
Process process;
|
||||
process.setTimeoutS(timeOutS);
|
||||
process.setWorkingDirectory(workingDir);
|
||||
process.setCodec(outputCodec ? outputCodec : QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
@@ -29,7 +29,7 @@ static void runProcess(QPromise<void> &promise, const ClearCaseSettings &setting
|
||||
std::function<void(const QString &buffer, int processed)> processLine)
|
||||
{
|
||||
const QString viewRoot = ClearCasePlugin::viewData().root;
|
||||
QtcProcess process;
|
||||
Process process;
|
||||
process.setWorkingDirectory(FilePath::fromString(viewRoot));
|
||||
process.setCommand({settings.ccBinaryPath, args});
|
||||
process.start();
|
||||
|
||||
@@ -1257,11 +1257,11 @@ void CMakeBuildSystem::runCTest()
|
||||
QTC_ASSERT(parameters.isValid(), return);
|
||||
|
||||
ensureBuildDirectory(parameters);
|
||||
m_ctestProcess.reset(new QtcProcess);
|
||||
m_ctestProcess.reset(new Process);
|
||||
m_ctestProcess->setEnvironment(buildConfiguration()->environment());
|
||||
m_ctestProcess->setWorkingDirectory(parameters.buildDirectory);
|
||||
m_ctestProcess->setCommand({m_ctestPath, { "-N", "--show-only=json-v1"}});
|
||||
connect(m_ctestProcess.get(), &QtcProcess::done, this, [this] {
|
||||
connect(m_ctestProcess.get(), &Process::done, this, [this] {
|
||||
if (m_ctestProcess->result() == ProcessResult::FinishedWithSuccess) {
|
||||
const QJsonDocument json
|
||||
= QJsonDocument::fromJson(m_ctestProcess->readAllRawStandardOutput());
|
||||
@@ -1735,12 +1735,12 @@ void CMakeBuildSystem::runGenerator(Id id)
|
||||
optionsAspect && !optionsAspect->value().isEmpty()) {
|
||||
cmdLine.addArgs(optionsAspect->value(), CommandLine::Raw);
|
||||
}
|
||||
const auto proc = new QtcProcess(this);
|
||||
connect(proc, &QtcProcess::done, proc, &QtcProcess::deleteLater);
|
||||
connect(proc, &QtcProcess::readyReadStandardOutput, this, [proc] {
|
||||
const auto proc = new Process(this);
|
||||
connect(proc, &Process::done, proc, &Process::deleteLater);
|
||||
connect(proc, &Process::readyReadStandardOutput, this, [proc] {
|
||||
Core::MessageManager::writeFlashing(QString::fromLocal8Bit(proc->readAllRawStandardOutput()));
|
||||
});
|
||||
connect(proc, &QtcProcess::readyReadStandardError, this, [proc] {
|
||||
connect(proc, &Process::readyReadStandardError, this, [proc] {
|
||||
Core::MessageManager::writeDisrupting(QString::fromLocal8Bit(proc->readAllRawStandardError()));
|
||||
});
|
||||
proc->setWorkingDirectory(outDir);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace ProjectExplorer {
|
||||
class ExtraCompiler;
|
||||
class FolderNode;
|
||||
}
|
||||
namespace Utils { class QtcProcess; }
|
||||
namespace Utils { class Process; }
|
||||
|
||||
namespace CMakeProjectManager {
|
||||
|
||||
@@ -233,7 +233,7 @@ private:
|
||||
|
||||
// CTest integration
|
||||
Utils::FilePath m_ctestPath;
|
||||
std::unique_ptr<Utils::QtcProcess> m_ctestProcess;
|
||||
std::unique_ptr<Utils::Process> m_ctestProcess;
|
||||
QList<ProjectExplorer::TestCaseInfo> m_testNames;
|
||||
|
||||
CMakeConfig m_configurationFromCMake;
|
||||
|
||||
@@ -106,7 +106,7 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList &
|
||||
// Always use the sourceDir: If we are triggered because the build directory is getting deleted
|
||||
// then we are racing against CMakeCache.txt also getting deleted.
|
||||
|
||||
m_process.reset(new QtcProcess);
|
||||
m_process.reset(new Process);
|
||||
|
||||
m_process->setWorkingDirectory(buildDirectory);
|
||||
m_process->setEnvironment(parameters.environment);
|
||||
@@ -120,7 +120,7 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList &
|
||||
BuildSystem::appendBuildSystemOutput(stripTrailingNewline(s));
|
||||
});
|
||||
|
||||
connect(m_process.get(), &QtcProcess::done, this, [this] {
|
||||
connect(m_process.get(), &Process::done, this, [this] {
|
||||
handleProcessDone(m_process->resultData());
|
||||
});
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
namespace Utils {
|
||||
class ProcessResultData;
|
||||
class QtcProcess;
|
||||
class Process;
|
||||
}
|
||||
|
||||
namespace CMakeProjectManager::Internal {
|
||||
@@ -37,7 +37,7 @@ signals:
|
||||
private:
|
||||
void handleProcessDone(const Utils::ProcessResultData &resultData);
|
||||
|
||||
std::unique_ptr<Utils::QtcProcess> m_process;
|
||||
std::unique_ptr<Utils::Process> m_process;
|
||||
Utils::OutputFormatter m_parser;
|
||||
QElapsedTimer m_elapsed;
|
||||
};
|
||||
|
||||
@@ -164,7 +164,7 @@ static CMakeConfig configurationFromPresetProbe(
|
||||
"project(preset-probe)\n"
|
||||
"\n"));
|
||||
|
||||
QtcProcess cmake;
|
||||
Process cmake;
|
||||
cmake.setTimeoutS(30);
|
||||
cmake.setDisableUnixTerminal();
|
||||
|
||||
@@ -341,7 +341,7 @@ static QMakeAndCMakePrefixPath qtInfoFromCMakeCache(const CMakeConfig &config,
|
||||
file(WRITE "${CMAKE_SOURCE_DIR}/cmake-prefix-path.txt" "${CMAKE_PREFIX_PATH}")
|
||||
)"));
|
||||
|
||||
QtcProcess cmake;
|
||||
Process cmake;
|
||||
cmake.setTimeoutS(5);
|
||||
cmake.setDisableUnixTerminal();
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ bool CMakeTool::isValid() const
|
||||
return m_introspection->m_didRun && !m_introspection->m_fileApis.isEmpty();
|
||||
}
|
||||
|
||||
void CMakeTool::runCMake(QtcProcess &cmake, const QStringList &args, int timeoutS) const
|
||||
void CMakeTool::runCMake(Process &cmake, const QStringList &args, int timeoutS) const
|
||||
{
|
||||
const FilePath executable = cmakeExecutable();
|
||||
cmake.setTimeoutS(timeoutS);
|
||||
@@ -248,7 +248,7 @@ TextEditor::Keywords CMakeTool::keywords()
|
||||
return {};
|
||||
|
||||
if (m_introspection->m_functions.isEmpty() && m_introspection->m_didRun) {
|
||||
QtcProcess proc;
|
||||
Process proc;
|
||||
runCMake(proc, {"--help-command-list"}, 5);
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess)
|
||||
m_introspection->m_functions = proc.cleanedStdOut().split('\n');
|
||||
@@ -492,7 +492,7 @@ QStringList CMakeTool::parseVariableOutput(const QString &output)
|
||||
|
||||
void CMakeTool::fetchFromCapabilities() const
|
||||
{
|
||||
QtcProcess cmake;
|
||||
Process cmake;
|
||||
runCMake(cmake, {"-E", "capabilities"});
|
||||
|
||||
if (cmake.result() == ProcessResult::FinishedWithSuccess) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
namespace Utils { class Process; }
|
||||
|
||||
namespace CMakeProjectManager {
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
private:
|
||||
void readInformation() const;
|
||||
|
||||
void runCMake(Utils::QtcProcess &proc, const QStringList &args, int timeoutS = 1) const;
|
||||
void runCMake(Utils::Process &proc, const QStringList &args, int timeoutS = 1) const;
|
||||
void parseFunctionDetailsOutput(const QString &output);
|
||||
QStringList parseVariableOutput(const QString &output);
|
||||
|
||||
|
||||
@@ -623,11 +623,11 @@ void ExternalToolRunner::run()
|
||||
DocumentManager::expectFileChange(m_expectedFilePath);
|
||||
}
|
||||
}
|
||||
m_process = new QtcProcess(this);
|
||||
connect(m_process, &QtcProcess::done, this, &ExternalToolRunner::done);
|
||||
connect(m_process, &QtcProcess::readyReadStandardOutput,
|
||||
m_process = new Process(this);
|
||||
connect(m_process, &Process::done, this, &ExternalToolRunner::done);
|
||||
connect(m_process, &Process::readyReadStandardOutput,
|
||||
this, &ExternalToolRunner::readStandardOutput);
|
||||
connect(m_process, &QtcProcess::readyReadStandardError,
|
||||
connect(m_process, &Process::readyReadStandardError,
|
||||
this, &ExternalToolRunner::readStandardError);
|
||||
if (!m_resolvedWorkingDirectory.isEmpty())
|
||||
m_process->setWorkingDirectory(m_resolvedWorkingDirectory);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <QTextCodec>
|
||||
#include <QMetaType>
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
namespace Utils { class Process; }
|
||||
|
||||
namespace Core {
|
||||
|
||||
@@ -127,7 +127,7 @@ private:
|
||||
QString m_resolvedInput;
|
||||
Utils::FilePath m_resolvedWorkingDirectory;
|
||||
Utils::Environment m_resolvedEnvironment;
|
||||
Utils::QtcProcess *m_process;
|
||||
Utils::Process *m_process;
|
||||
QTextCodec *m_outputCodec;
|
||||
QTextCodec::ConverterState m_outputCodecState;
|
||||
QTextCodec::ConverterState m_errorCodecState;
|
||||
|
||||
@@ -68,9 +68,9 @@ void FileUtils::showInGraphicalShell(QWidget *parent, const FilePath &pathIn)
|
||||
if (!pathIn.isDir())
|
||||
param += QLatin1String("/select,");
|
||||
param += QDir::toNativeSeparators(fileInfo.canonicalFilePath());
|
||||
QtcProcess::startDetached({explorer, param});
|
||||
Process::startDetached({explorer, param});
|
||||
} else if (HostOsInfo::isMacHost()) {
|
||||
QtcProcess::startDetached({"/usr/bin/open", {"-R", fileInfo.canonicalFilePath()}});
|
||||
Process::startDetached({"/usr/bin/open", {"-R", fileInfo.canonicalFilePath()}});
|
||||
} else {
|
||||
// we cannot select a file here, because no file browser really supports it...
|
||||
const QString folder = fileInfo.isDir() ? fileInfo.absoluteFilePath() : fileInfo.filePath();
|
||||
|
||||
@@ -196,11 +196,11 @@ void ExecuteFilter::createProcess()
|
||||
if (m_process)
|
||||
return;
|
||||
|
||||
m_process = new QtcProcess;
|
||||
m_process = new Process;
|
||||
m_process->setEnvironment(Environment::systemEnvironment());
|
||||
connect(m_process, &QtcProcess::done, this, &ExecuteFilter::done);
|
||||
connect(m_process, &QtcProcess::readyReadStandardOutput, this, &ExecuteFilter::readStandardOutput);
|
||||
connect(m_process, &QtcProcess::readyReadStandardError, this, &ExecuteFilter::readStandardError);
|
||||
connect(m_process, &Process::done, this, &ExecuteFilter::done);
|
||||
connect(m_process, &Process::readyReadStandardOutput, this, &ExecuteFilter::readStandardOutput);
|
||||
connect(m_process, &Process::readyReadStandardError, this, &ExecuteFilter::readStandardError);
|
||||
}
|
||||
|
||||
void ExecuteFilter::removeProcess()
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <QStringList>
|
||||
#include <QTextCodec>
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
namespace Utils { class Process; }
|
||||
|
||||
namespace Core {
|
||||
namespace Internal {
|
||||
@@ -49,7 +49,7 @@ private:
|
||||
|
||||
QQueue<ExecuteData> m_taskQueue;
|
||||
QStringList m_commandHistory;
|
||||
Utils::QtcProcess *m_process = nullptr;
|
||||
Utils::Process *m_process = nullptr;
|
||||
QTextCodec::ConverterState m_stdoutState;
|
||||
QTextCodec::ConverterState m_stderrState;
|
||||
};
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
private:
|
||||
void ensureNext();
|
||||
|
||||
std::unique_ptr<QtcProcess> m_process;
|
||||
std::unique_ptr<Process> m_process;
|
||||
QMutex m_mutex;
|
||||
QWaitCondition m_waitForItems;
|
||||
FilePaths m_queue;
|
||||
@@ -67,10 +67,10 @@ SpotlightIterator::SpotlightIterator(const CommandLine &command)
|
||||
, m_finished(false)
|
||||
{
|
||||
QTC_ASSERT(!command.isEmpty(), return );
|
||||
m_process.reset(new QtcProcess);
|
||||
m_process.reset(new Process);
|
||||
m_process->setCommand(command);
|
||||
m_process->setEnvironment(Utils::Environment::systemEnvironment());
|
||||
QObject::connect(m_process.get(), &QtcProcess::done,
|
||||
QObject::connect(m_process.get(), &Process::done,
|
||||
m_process.get(), [this, exe = command.executable().toUserOutput()] {
|
||||
if (m_process->result() != ProcessResult::FinishedWithSuccess) {
|
||||
MessageManager::writeFlashing(Tr::tr(
|
||||
@@ -78,7 +78,7 @@ SpotlightIterator::SpotlightIterator(const CommandLine &command)
|
||||
}
|
||||
scheduleKillProcess();
|
||||
});
|
||||
QObject::connect(m_process.get(), &QtcProcess::readyReadStandardOutput,
|
||||
QObject::connect(m_process.get(), &Process::readyReadStandardOutput,
|
||||
m_process.get(), [this] {
|
||||
QString output = m_process->readAllStandardOutput();
|
||||
output.replace("\r\n", "\n");
|
||||
@@ -250,11 +250,11 @@ static void matches(QPromise<void> &promise, const LocatorStorage &storage,
|
||||
const bool hasPathSeparator = newInput.contains('/') || newInput.contains('*');
|
||||
LocatorFileCache::MatchedEntries entries = {};
|
||||
QEventLoop loop;
|
||||
QtcProcess process;
|
||||
Process process;
|
||||
process.setCommand(command);
|
||||
process.setEnvironment(Environment::systemEnvironment()); // TODO: Is it needed?
|
||||
|
||||
QObject::connect(&process, &QtcProcess::readyReadStandardOutput, &process,
|
||||
QObject::connect(&process, &Process::readyReadStandardOutput, &process,
|
||||
[&, entriesPtr = &entries] {
|
||||
QString output = process.readAllStandardOutput();
|
||||
output.replace("\r\n", "\n");
|
||||
@@ -265,7 +265,7 @@ static void matches(QPromise<void> &promise, const LocatorStorage &storage,
|
||||
if (promise.isCanceled())
|
||||
loop.exit();
|
||||
});
|
||||
QObject::connect(&process, &QtcProcess::done, &process, [&] {
|
||||
QObject::connect(&process, &Process::done, &process, [&] {
|
||||
if (process.result() != ProcessResult::FinishedWithSuccess) {
|
||||
MessageManager::writeFlashing(Tr::tr("Locator: Error occurred when running \"%1\".")
|
||||
.arg(command.executable().toUserOutput()));
|
||||
|
||||
@@ -76,7 +76,7 @@ static bool runPatchHelper(const QByteArray &input, const FilePath &workingDirec
|
||||
return false;
|
||||
}
|
||||
|
||||
QtcProcess patchProcess;
|
||||
Process patchProcess;
|
||||
if (!workingDirectory.isEmpty())
|
||||
patchProcess.setWorkingDirectory(workingDirectory);
|
||||
Environment env = Environment::systemEnvironment();
|
||||
|
||||
@@ -403,7 +403,7 @@ static std::function<void(FilePath)> postCopyOperation()
|
||||
return;
|
||||
// On macOS, downloaded files get a quarantine flag, remove it, otherwise it is a hassle
|
||||
// to get it loaded as a plugin in Qt Creator.
|
||||
QtcProcess xattr;
|
||||
Process xattr;
|
||||
xattr.setTimeoutS(1);
|
||||
xattr.setCommand({"/usr/bin/xattr", {"-d", "com.apple.quarantine", filePath.absoluteFilePath().toString()}});
|
||||
xattr.runBlocking();
|
||||
|
||||
@@ -18,13 +18,13 @@ namespace Core {
|
||||
class ProcessProgressPrivate : public QObject
|
||||
{
|
||||
public:
|
||||
explicit ProcessProgressPrivate(ProcessProgress *progress, QtcProcess *process);
|
||||
explicit ProcessProgressPrivate(ProcessProgress *progress, Process *process);
|
||||
~ProcessProgressPrivate();
|
||||
|
||||
QString displayName() const;
|
||||
void parseProgress(const QString &inputText);
|
||||
|
||||
QtcProcess *m_process = nullptr;
|
||||
Process *m_process = nullptr;
|
||||
ProgressParser m_parser = {};
|
||||
QFutureWatcher<void> m_watcher;
|
||||
QFutureInterface<void> m_futureInterface;
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
FutureProgress::KeepOnFinishType m_keep = FutureProgress::HideOnFinish;
|
||||
};
|
||||
|
||||
ProcessProgressPrivate::ProcessProgressPrivate(ProcessProgress *progress, QtcProcess *process)
|
||||
ProcessProgressPrivate::ProcessProgressPrivate(ProcessProgress *progress, Process *process)
|
||||
: QObject(progress)
|
||||
, m_process(process)
|
||||
{
|
||||
@@ -77,14 +77,14 @@ void ProcessProgressPrivate::parseProgress(const QString &inputText)
|
||||
indicator on progress panel. In this case QtcProcess::stop() method is being called.
|
||||
*/
|
||||
|
||||
ProcessProgress::ProcessProgress(QtcProcess *process)
|
||||
ProcessProgress::ProcessProgress(Process *process)
|
||||
: QObject(process)
|
||||
, d(new ProcessProgressPrivate(this, process))
|
||||
{
|
||||
connect(&d->m_watcher, &QFutureWatcher<void>::canceled, this, [this] {
|
||||
d->m_process->stop(); // TODO: See TaskProgress::setAutoStopOnCancel
|
||||
});
|
||||
connect(d->m_process, &QtcProcess::starting, this, [this] {
|
||||
connect(d->m_process, &Process::starting, this, [this] {
|
||||
d->m_futureInterface = QFutureInterface<void>();
|
||||
d->m_futureInterface.setProgressRange(0, 1);
|
||||
d->m_watcher.setFuture(d->m_futureInterface.future());
|
||||
@@ -100,7 +100,7 @@ ProcessProgress::ProcessProgress(QtcProcess *process)
|
||||
}
|
||||
d->m_futureProgress->setKeepOnFinish(d->m_keep);
|
||||
});
|
||||
connect(d->m_process, &QtcProcess::done, this, [this] {
|
||||
connect(d->m_process, &Process::done, this, [this] {
|
||||
if (d->m_process->result() != ProcessResult::FinishedWithSuccess)
|
||||
d->m_futureInterface.reportCanceled();
|
||||
d->m_futureInterface.reportFinished();
|
||||
@@ -124,9 +124,9 @@ void ProcessProgress::setKeepOnFinish(FutureProgress::KeepOnFinishType keepType)
|
||||
void ProcessProgress::setProgressParser(const ProgressParser &parser)
|
||||
{
|
||||
if (d->m_parser) {
|
||||
disconnect(d->m_process, &QtcProcess::textOnStandardOutput,
|
||||
disconnect(d->m_process, &Process::textOnStandardOutput,
|
||||
d.get(), &ProcessProgressPrivate::parseProgress);
|
||||
disconnect(d->m_process, &QtcProcess::textOnStandardError,
|
||||
disconnect(d->m_process, &Process::textOnStandardError,
|
||||
d.get(), &ProcessProgressPrivate::parseProgress);
|
||||
}
|
||||
d->m_parser = parser;
|
||||
@@ -137,9 +137,9 @@ void ProcessProgress::setProgressParser(const ProgressParser &parser)
|
||||
qWarning() << "Setting progress parser on a process without changing process' "
|
||||
"text channel mode is no-op.");
|
||||
|
||||
connect(d->m_process, &QtcProcess::textOnStandardOutput,
|
||||
connect(d->m_process, &Process::textOnStandardOutput,
|
||||
d.get(), &ProcessProgressPrivate::parseProgress);
|
||||
connect(d->m_process, &QtcProcess::textOnStandardError,
|
||||
connect(d->m_process, &Process::textOnStandardError,
|
||||
d.get(), &ProcessProgressPrivate::parseProgress);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
namespace Utils { class Process; }
|
||||
|
||||
namespace Core {
|
||||
|
||||
@@ -20,7 +20,7 @@ class ProcessProgressPrivate;
|
||||
class CORE_EXPORT ProcessProgress : public QObject
|
||||
{
|
||||
public:
|
||||
ProcessProgress(Utils::QtcProcess *process); // Makes ProcessProgress a child of process
|
||||
ProcessProgress(Utils::Process *process); // Makes ProcessProgress a child of process
|
||||
~ProcessProgress() override;
|
||||
|
||||
void setDisplayName(const QString &name);
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Cppcheck::Internal {
|
||||
CppcheckRunner::CppcheckRunner(CppcheckTool &tool) : m_tool(tool)
|
||||
{
|
||||
if (HostOsInfo::hostOs() == OsTypeLinux) {
|
||||
QtcProcess getConf;
|
||||
Process getConf;
|
||||
getConf.setCommand({"getconf", {"ARG_MAX"}});
|
||||
getConf.start();
|
||||
getConf.waitForFinished(2000);
|
||||
@@ -31,8 +31,8 @@ CppcheckRunner::CppcheckRunner(CppcheckTool &tool) : m_tool(tool)
|
||||
m_tool.parseErrorLine(line);
|
||||
});
|
||||
|
||||
connect(&m_process, &QtcProcess::started, &m_tool, &CppcheckTool::startParsing);
|
||||
connect(&m_process, &QtcProcess::done, this, &CppcheckRunner::handleDone);
|
||||
connect(&m_process, &Process::started, &m_tool, &CppcheckTool::startParsing);
|
||||
connect(&m_process, &Process::done, this, &CppcheckRunner::handleDone);
|
||||
|
||||
m_queueTimer.setSingleShot(true);
|
||||
const int checkDelayInMs = 200;
|
||||
|
||||
@@ -35,7 +35,7 @@ private:
|
||||
void handleDone();
|
||||
|
||||
CppcheckTool &m_tool;
|
||||
Utils::QtcProcess m_process;
|
||||
Utils::Process m_process;
|
||||
Utils::FilePath m_binary;
|
||||
QString m_arguments;
|
||||
QHash<QString, Utils::FilePaths> m_queue;
|
||||
|
||||
@@ -340,7 +340,7 @@ static FilePath getClangHeadersPathFromClang(const FilePath &clangdFilePath)
|
||||
.withExecutableSuffix();
|
||||
if (!clangFilePath.exists())
|
||||
return {};
|
||||
QtcProcess clang;
|
||||
Process clang;
|
||||
clang.setCommand({clangFilePath, {"-print-resource-dir"}});
|
||||
clang.start();
|
||||
if (!clang.waitForFinished())
|
||||
|
||||
@@ -449,10 +449,10 @@ void CppModelManager::showPreprocessedFile(bool inNextSplit)
|
||||
compilerArgs.append("/E");
|
||||
compilerArgs.append(filePath.toUserOutput());
|
||||
const CommandLine compilerCommandLine(tc->compilerCommand(), compilerArgs);
|
||||
const auto compiler = new QtcProcess(instance());
|
||||
const auto compiler = new Process(instance());
|
||||
compiler->setCommand(compilerCommandLine);
|
||||
compiler->setEnvironment(project->activeTarget()->activeBuildConfiguration()->environment());
|
||||
connect(compiler, &QtcProcess::done, instance(), [compiler, outFilePath, inNextSplit,
|
||||
connect(compiler, &Process::done, instance(), [compiler, outFilePath, inNextSplit,
|
||||
useBuiltinPreprocessor, isMsvc] {
|
||||
compiler->deleteLater();
|
||||
if (compiler->result() != ProcessResult::FinishedWithSuccess) {
|
||||
|
||||
@@ -182,8 +182,8 @@ CdbEngine::CdbEngine() :
|
||||
DebuggerSettings *s = debuggerSettings();
|
||||
connect(s->createFullBacktrace.action(), &QAction::triggered,
|
||||
this, &CdbEngine::createFullBacktrace);
|
||||
connect(&m_process, &QtcProcess::started, this, &CdbEngine::processStarted);
|
||||
connect(&m_process, &QtcProcess::done, this, &CdbEngine::processDone);
|
||||
connect(&m_process, &Process::started, this, &CdbEngine::processStarted);
|
||||
connect(&m_process, &Process::done, this, &CdbEngine::processDone);
|
||||
m_process.setStdOutLineCallback([this](const QString &line) { parseOutputLine(line); });
|
||||
m_process.setStdErrLineCallback([this](const QString &line) { parseOutputLine(line); });
|
||||
connect(&s->useDebuggingHelpers, &BaseAspect::changed,
|
||||
|
||||
@@ -174,7 +174,7 @@ private:
|
||||
const QString m_tokenPrefix;
|
||||
void handleSetupFailure(const QString &errorMessage);
|
||||
|
||||
Utils::QtcProcess m_process;
|
||||
Utils::Process m_process;
|
||||
DebuggerStartMode m_effectiveStartMode = NoStartMode;
|
||||
//! Debugger accessible (expecting commands)
|
||||
bool m_accessible = false;
|
||||
|
||||
@@ -112,10 +112,10 @@ void DapEngine::setupEngine()
|
||||
{
|
||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||
|
||||
connect(&m_proc, &QtcProcess::started, this, &DapEngine::handleDabStarted);
|
||||
connect(&m_proc, &QtcProcess::done, this, &DapEngine::handleDapDone);
|
||||
connect(&m_proc, &QtcProcess::readyReadStandardOutput, this, &DapEngine::readDapStandardOutput);
|
||||
connect(&m_proc, &QtcProcess::readyReadStandardError, this, &DapEngine::readDapStandardError);
|
||||
connect(&m_proc, &Process::started, this, &DapEngine::handleDabStarted);
|
||||
connect(&m_proc, &Process::done, this, &DapEngine::handleDapDone);
|
||||
connect(&m_proc, &Process::readyReadStandardOutput, this, &DapEngine::readDapStandardOutput);
|
||||
connect(&m_proc, &Process::readyReadStandardError, this, &DapEngine::readDapStandardError);
|
||||
|
||||
const DebuggerRunParameters &rp = runParameters();
|
||||
const CommandLine cmd{rp.debugger.command.executable(), {"-i", "dap"}};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user