forked from qt-creator/qt-creator
QtcProcess: Extract QtcProcess specific enums into separate header
Change-Id: Ib3498f189000fd8f5501130c0d280b0f5ae83849 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -121,6 +121,7 @@ add_qtc_library(Utils
|
|||||||
porting.h
|
porting.h
|
||||||
portlist.cpp portlist.h
|
portlist.cpp portlist.h
|
||||||
predicates.h
|
predicates.h
|
||||||
|
processenums.h
|
||||||
processhandle.cpp processhandle.h
|
processhandle.cpp processhandle.h
|
||||||
processreaper.cpp processreaper.h
|
processreaper.cpp processreaper.h
|
||||||
processutils.cpp processutils.h
|
processutils.cpp processutils.h
|
||||||
|
@@ -28,7 +28,6 @@
|
|||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include "processreaper.h"
|
#include "processreaper.h"
|
||||||
#include "processutils.h"
|
|
||||||
#include "singleton.h"
|
#include "singleton.h"
|
||||||
|
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "processutils.h"
|
#include "processenums.h"
|
||||||
|
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
@@ -28,7 +28,6 @@
|
|||||||
#include "environment.h"
|
#include "environment.h"
|
||||||
#include "filepath.h"
|
#include "filepath.h"
|
||||||
#include "launcherpackets.h"
|
#include "launcherpackets.h"
|
||||||
#include "processutils.h"
|
|
||||||
#include "qtcprocess.h"
|
#include "qtcprocess.h"
|
||||||
|
|
||||||
#include <QDeadlineTimer>
|
#include <QDeadlineTimer>
|
||||||
|
55
src/libs/utils/processenums.h
Normal file
55
src/libs/utils/processenums.h
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QMetaType>
|
||||||
|
|
||||||
|
namespace Utils {
|
||||||
|
|
||||||
|
enum class ProcessMode {
|
||||||
|
Reader, // This opens in ReadOnly mode if no write data or in ReadWrite mode otherwise,
|
||||||
|
// closes the write channel afterwards.
|
||||||
|
Writer // This opens in ReadWrite mode and doesn't close the write channel
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class ProcessImpl {
|
||||||
|
QProcess,
|
||||||
|
ProcessLauncher,
|
||||||
|
Default // Defaults to ProcessLauncherImpl, if QTC_USE_QPROCESS env var is set
|
||||||
|
// it equals to QProcessImpl.
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class TerminalMode {
|
||||||
|
Off,
|
||||||
|
Run,
|
||||||
|
Debug,
|
||||||
|
Suspend,
|
||||||
|
On = Run // Default mode for terminal set to on
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Utils
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(Utils::ProcessMode);
|
@@ -25,17 +25,13 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "processenums.h"
|
||||||
|
|
||||||
#include <QIODevice>
|
#include <QIODevice>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
enum class ProcessMode {
|
|
||||||
Reader, // This opens in ReadOnly mode if no write data or in ReadWrite mode otherwise,
|
|
||||||
// closes the write channel afterwards
|
|
||||||
Writer // This opens in ReadWrite mode and doesn't close the write channel
|
|
||||||
};
|
|
||||||
|
|
||||||
class ProcessStartHandler {
|
class ProcessStartHandler {
|
||||||
public:
|
public:
|
||||||
ProcessStartHandler(QProcess *process) : m_process(process) {}
|
ProcessStartHandler(QProcess *process) : m_process(process) {}
|
||||||
@@ -83,5 +79,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Utils
|
} // namespace Utils
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(Utils::ProcessMode);
|
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#include "launcherpackets.h"
|
#include "launcherpackets.h"
|
||||||
#include "launchersocket.h"
|
#include "launchersocket.h"
|
||||||
#include "processreaper.h"
|
#include "processreaper.h"
|
||||||
|
#include "processutils.h"
|
||||||
#include "stringutils.h"
|
#include "stringutils.h"
|
||||||
#include "terminalprocess_p.h"
|
#include "terminalprocess_p.h"
|
||||||
|
|
||||||
@@ -217,8 +218,7 @@ public:
|
|||||||
class TerminalImpl : public ProcessInterface
|
class TerminalImpl : public ProcessInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TerminalImpl(QObject *parent, QtcProcess::ProcessImpl processImpl,
|
TerminalImpl(QObject *parent, ProcessImpl processImpl, TerminalMode terminalMode)
|
||||||
QtcProcess::TerminalMode terminalMode)
|
|
||||||
: ProcessInterface(parent)
|
: ProcessInterface(parent)
|
||||||
, m_terminal(this, processImpl, terminalMode)
|
, m_terminal(this, processImpl, terminalMode)
|
||||||
{
|
{
|
||||||
@@ -431,11 +431,11 @@ void ProcessLauncherImpl::cancel()
|
|||||||
m_handle->cancel();
|
m_handle->cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
static QtcProcess::ProcessImpl defaultProcessImpl()
|
static ProcessImpl defaultProcessImpl()
|
||||||
{
|
{
|
||||||
if (qEnvironmentVariableIsSet("QTC_USE_QPROCESS"))
|
if (qEnvironmentVariableIsSet("QTC_USE_QPROCESS"))
|
||||||
return QtcProcess::QProcessImpl;
|
return ProcessImpl::QProcess;
|
||||||
return QtcProcess::ProcessLauncherImpl;
|
return ProcessImpl::ProcessLauncher;
|
||||||
}
|
}
|
||||||
|
|
||||||
class QtcProcessPrivate : public QObject
|
class QtcProcessPrivate : public QObject
|
||||||
@@ -454,12 +454,12 @@ public:
|
|||||||
|
|
||||||
ProcessInterface *createProcessInterface()
|
ProcessInterface *createProcessInterface()
|
||||||
{
|
{
|
||||||
const QtcProcess::ProcessImpl impl = m_setup.m_processImpl == QtcProcess::DefaultImpl
|
const ProcessImpl impl = m_setup.m_processImpl == ProcessImpl::Default
|
||||||
? defaultProcessImpl() : m_setup.m_processImpl;
|
? defaultProcessImpl() : m_setup.m_processImpl;
|
||||||
|
|
||||||
if (m_setup.m_terminalMode != QtcProcess::TerminalOff)
|
if (m_setup.m_terminalMode != TerminalMode::Off)
|
||||||
return new TerminalImpl(parent(), impl, m_setup.m_terminalMode);
|
return new TerminalImpl(parent(), impl, m_setup.m_terminalMode);
|
||||||
else if (impl == QtcProcess::QProcessImpl)
|
else if (impl == ProcessImpl::QProcess)
|
||||||
return new QProcessImpl(parent());
|
return new QProcessImpl(parent());
|
||||||
return new ProcessLauncherImpl(parent());
|
return new ProcessLauncherImpl(parent());
|
||||||
}
|
}
|
||||||
@@ -717,7 +717,7 @@ void QtcProcess::setTerminalMode(TerminalMode mode)
|
|||||||
d->m_setup.m_terminalMode = mode;
|
d->m_setup.m_terminalMode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
QtcProcess::TerminalMode QtcProcess::terminalMode() const
|
TerminalMode QtcProcess::terminalMode() const
|
||||||
{
|
{
|
||||||
return d->m_setup.m_terminalMode;
|
return d->m_setup.m_terminalMode;
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include "environment.h"
|
#include "environment.h"
|
||||||
#include "commandline.h"
|
#include "commandline.h"
|
||||||
#include "processutils.h"
|
#include "processenums.h"
|
||||||
#include "qtcassert.h"
|
#include "qtcassert.h"
|
||||||
|
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
@@ -63,20 +63,6 @@ public:
|
|||||||
QtcProcess(QObject *parent = nullptr);
|
QtcProcess(QObject *parent = nullptr);
|
||||||
~QtcProcess();
|
~QtcProcess();
|
||||||
|
|
||||||
enum ProcessImpl {
|
|
||||||
QProcessImpl,
|
|
||||||
ProcessLauncherImpl,
|
|
||||||
DefaultImpl,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum TerminalMode {
|
|
||||||
TerminalOff,
|
|
||||||
TerminalRun,
|
|
||||||
TerminalDebug,
|
|
||||||
TerminalSuspend,
|
|
||||||
TerminalOn = TerminalRun // default mode for ON
|
|
||||||
};
|
|
||||||
|
|
||||||
void setProcessInterface(ProcessInterface *interface);
|
void setProcessInterface(ProcessInterface *interface);
|
||||||
|
|
||||||
// ProcessInterface related
|
// ProcessInterface related
|
||||||
@@ -113,7 +99,7 @@ public:
|
|||||||
|
|
||||||
void setTerminalMode(TerminalMode mode);
|
void setTerminalMode(TerminalMode mode);
|
||||||
TerminalMode terminalMode() const;
|
TerminalMode terminalMode() const;
|
||||||
bool usesTerminal() const { return terminalMode() != TerminalOff; }
|
bool usesTerminal() const { return terminalMode() != TerminalMode::Off; }
|
||||||
|
|
||||||
void setProcessMode(ProcessMode processMode);
|
void setProcessMode(ProcessMode processMode);
|
||||||
ProcessMode processMode() const;
|
ProcessMode processMode() const;
|
||||||
@@ -253,9 +239,9 @@ private:
|
|||||||
class QTCREATOR_UTILS_EXPORT ProcessSetupData
|
class QTCREATOR_UTILS_EXPORT ProcessSetupData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QtcProcess::ProcessImpl m_processImpl = QtcProcess::DefaultImpl;
|
ProcessImpl m_processImpl = ProcessImpl::Default;
|
||||||
ProcessMode m_processMode = ProcessMode::Reader;
|
ProcessMode m_processMode = ProcessMode::Reader;
|
||||||
QtcProcess::TerminalMode m_terminalMode = QtcProcess::TerminalOff;
|
TerminalMode m_terminalMode = TerminalMode::Off;
|
||||||
|
|
||||||
CommandLine m_commandLine;
|
CommandLine m_commandLine;
|
||||||
FilePath m_workingDirectory;
|
FilePath m_workingDirectory;
|
||||||
|
@@ -63,16 +63,16 @@
|
|||||||
namespace Utils {
|
namespace Utils {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
static QString modeOption(QtcProcess::TerminalMode m)
|
static QString modeOption(TerminalMode m)
|
||||||
{
|
{
|
||||||
switch (m) {
|
switch (m) {
|
||||||
case QtcProcess::TerminalRun:
|
case TerminalMode::Run:
|
||||||
return QLatin1String("run");
|
return QLatin1String("run");
|
||||||
case QtcProcess::TerminalDebug:
|
case TerminalMode::Debug:
|
||||||
return QLatin1String("debug");
|
return QLatin1String("debug");
|
||||||
case QtcProcess::TerminalSuspend:
|
case TerminalMode::Suspend:
|
||||||
return QLatin1String("suspend");
|
return QLatin1String("suspend");
|
||||||
case QtcProcess::TerminalOff:
|
case TerminalMode::Off:
|
||||||
QTC_CHECK(false);
|
QTC_CHECK(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -123,15 +123,14 @@ static QString msgCannotExecute(const QString & p, const QString &why)
|
|||||||
class TerminalProcessPrivate
|
class TerminalProcessPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TerminalProcessPrivate(QObject *parent, QtcProcess::ProcessImpl processImpl,
|
TerminalProcessPrivate(QObject *parent, ProcessImpl processImpl, TerminalMode terminalMode)
|
||||||
QtcProcess::TerminalMode terminalMode)
|
|
||||||
: m_terminalMode(terminalMode)
|
: m_terminalMode(terminalMode)
|
||||||
, m_process(parent)
|
, m_process(parent)
|
||||||
{
|
{
|
||||||
m_process.setProcessImpl(processImpl);
|
m_process.setProcessImpl(processImpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QtcProcess::TerminalMode m_terminalMode;
|
const TerminalMode m_terminalMode;
|
||||||
FilePath m_workingDir;
|
FilePath m_workingDir;
|
||||||
Environment m_environment;
|
Environment m_environment;
|
||||||
qint64 m_processId = 0;
|
qint64 m_processId = 0;
|
||||||
@@ -161,9 +160,9 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
TerminalProcess::TerminalProcess(QObject *parent, QtcProcess::ProcessImpl processImpl,
|
TerminalProcess::TerminalProcess(QObject *parent, ProcessImpl processImpl,
|
||||||
QtcProcess::TerminalMode terminalMode) :
|
TerminalMode terminalMode)
|
||||||
QObject(parent), d(new TerminalProcessPrivate(this, processImpl, terminalMode))
|
: QObject(parent), d(new TerminalProcessPrivate(this, processImpl, terminalMode))
|
||||||
{
|
{
|
||||||
connect(&d->m_stubServer, &QLocalServer::newConnection,
|
connect(&d->m_stubServer, &QLocalServer::newConnection,
|
||||||
this, &TerminalProcess::stubConnectionAvailable);
|
this, &TerminalProcess::stubConnectionAvailable);
|
||||||
@@ -211,7 +210,7 @@ void TerminalProcess::start()
|
|||||||
|
|
||||||
QString pcmd;
|
QString pcmd;
|
||||||
QString pargs;
|
QString pargs;
|
||||||
if (d->m_terminalMode != QtcProcess::TerminalRun) { // The debugger engines already pre-process the arguments.
|
if (d->m_terminalMode != TerminalMode::Run) { // The debugger engines already pre-process the arguments.
|
||||||
pcmd = d->m_commandLine.executable().toString();
|
pcmd = d->m_commandLine.executable().toString();
|
||||||
pargs = d->m_commandLine.arguments();
|
pargs = d->m_commandLine.arguments();
|
||||||
} else {
|
} else {
|
||||||
@@ -376,7 +375,7 @@ void TerminalProcess::start()
|
|||||||
emitError(QProcess::FailedToStart, tr("Quoting error in command."));
|
emitError(QProcess::FailedToStart, tr("Quoting error in command."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (d->m_terminalMode == QtcProcess::TerminalDebug) {
|
if (d->m_terminalMode == TerminalMode::Debug) {
|
||||||
// FIXME: QTCREATORBUG-2809
|
// FIXME: QTCREATORBUG-2809
|
||||||
emitError(QProcess::FailedToStart, tr("Debugging complex shell commands in a terminal"
|
emitError(QProcess::FailedToStart, tr("Debugging complex shell commands in a terminal"
|
||||||
" is currently not supported."));
|
" is currently not supported."));
|
||||||
|
@@ -25,7 +25,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "qtcprocess.h"
|
#include "processenums.h"
|
||||||
|
|
||||||
|
#include <QProcess>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
@@ -39,8 +41,7 @@ class TerminalProcess : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit TerminalProcess(QObject *parent, QtcProcess::ProcessImpl processImpl,
|
explicit TerminalProcess(QObject *parent, ProcessImpl processImpl, TerminalMode terminalMode);
|
||||||
QtcProcess::TerminalMode terminalMode);
|
|
||||||
~TerminalProcess() override;
|
~TerminalProcess() override;
|
||||||
|
|
||||||
void setCommand(const CommandLine &command);
|
void setCommand(const CommandLine &command);
|
||||||
|
@@ -218,6 +218,7 @@ Project {
|
|||||||
"porting.h",
|
"porting.h",
|
||||||
"portlist.cpp",
|
"portlist.cpp",
|
||||||
"portlist.h",
|
"portlist.h",
|
||||||
|
"processenums.h",
|
||||||
"processhandle.cpp",
|
"processhandle.cpp",
|
||||||
"processhandle.h",
|
"processhandle.h",
|
||||||
"processreaper.cpp",
|
"processreaper.cpp",
|
||||||
|
@@ -196,7 +196,7 @@ void TerminalRunner::start()
|
|||||||
|
|
||||||
m_stubProc = new QtcProcess(this);
|
m_stubProc = new QtcProcess(this);
|
||||||
m_stubProc->setTerminalMode(HostOsInfo::isWindowsHost()
|
m_stubProc->setTerminalMode(HostOsInfo::isWindowsHost()
|
||||||
? QtcProcess::TerminalSuspend : QtcProcess::TerminalDebug);
|
? TerminalMode::Suspend : TerminalMode::Debug);
|
||||||
|
|
||||||
connect(m_stubProc, &QtcProcess::errorOccurred,
|
connect(m_stubProc, &QtcProcess::errorOccurred,
|
||||||
this, &TerminalRunner::stubError);
|
this, &TerminalRunner::stubError);
|
||||||
|
@@ -534,7 +534,7 @@ DockerDevice::DockerDevice(const DockerDeviceData &data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QtcProcess *proc = new QtcProcess;
|
QtcProcess *proc = new QtcProcess;
|
||||||
proc->setTerminalMode(QtcProcess::TerminalOn);
|
proc->setTerminalMode(TerminalMode::On);
|
||||||
|
|
||||||
QObject::connect(proc, &QtcProcess::finished, proc, &QObject::deleteLater);
|
QObject::connect(proc, &QtcProcess::finished, proc, &QObject::deleteLater);
|
||||||
|
|
||||||
|
@@ -190,7 +190,7 @@ void ApplicationLauncherPrivate::stop()
|
|||||||
return;
|
return;
|
||||||
m_stopRequested = true;
|
m_stopRequested = true;
|
||||||
emit q->appendMessage(ApplicationLauncher::tr("User requested stop. Shutting down..."),
|
emit q->appendMessage(ApplicationLauncher::tr("User requested stop. Shutting down..."),
|
||||||
Utils::NormalMessageFormat);
|
NormalMessageFormat);
|
||||||
switch (m_state) {
|
switch (m_state) {
|
||||||
case Run:
|
case Run:
|
||||||
m_process->terminate();
|
m_process->terminate();
|
||||||
@@ -439,7 +439,7 @@ void ApplicationLauncherPrivate::start(const IDevice::ConstPtr &device, bool loc
|
|||||||
this, &ApplicationLauncherPrivate::handleStandardOutput);
|
this, &ApplicationLauncherPrivate::handleStandardOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_process->setTerminalMode(m_useTerminal ? QtcProcess::TerminalOn : QtcProcess::TerminalOff);
|
m_process->setTerminalMode(m_useTerminal ? Utils::TerminalMode::On : Utils::TerminalMode::Off);
|
||||||
m_process->start();
|
m_process->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1680,7 +1680,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
if (tmp < 0 || tmp > int(StopBeforeBuild::SameApp))
|
if (tmp < 0 || tmp > int(StopBeforeBuild::SameApp))
|
||||||
tmp = int(defaultSettings.stopBeforeBuild);
|
tmp = int(defaultSettings.stopBeforeBuild);
|
||||||
dd->m_projectExplorerSettings.stopBeforeBuild = StopBeforeBuild(tmp);
|
dd->m_projectExplorerSettings.stopBeforeBuild = StopBeforeBuild(tmp);
|
||||||
dd->m_projectExplorerSettings.terminalMode = static_cast<TerminalMode>(
|
dd->m_projectExplorerSettings.terminalMode = static_cast<Internal::TerminalMode>(
|
||||||
s->value(Constants::TERMINAL_MODE_SETTINGS_KEY, int(defaultSettings.terminalMode)).toInt());
|
s->value(Constants::TERMINAL_MODE_SETTINGS_KEY, int(defaultSettings.terminalMode)).toInt());
|
||||||
dd->m_projectExplorerSettings.closeSourceFilesWithProject
|
dd->m_projectExplorerSettings.closeSourceFilesWithProject
|
||||||
= s->value(Constants::CLOSE_FILES_WITH_PROJECT_SETTINGS_KEY,
|
= s->value(Constants::CLOSE_FILES_WITH_PROJECT_SETTINGS_KEY,
|
||||||
|
@@ -108,7 +108,7 @@ void openPythonRepl(QObject *parent, const FilePath &file, ReplType type)
|
|||||||
|
|
||||||
const auto args = QStringList{"-i"} + replImportArgs(file, type);
|
const auto args = QStringList{"-i"} + replImportArgs(file, type);
|
||||||
auto process = new QtcProcess(parent);
|
auto process = new QtcProcess(parent);
|
||||||
process->setTerminalMode(QtcProcess::TerminalOn);
|
process->setTerminalMode(TerminalMode::On);
|
||||||
const FilePath pythonCommand = detectPython(file);
|
const FilePath pythonCommand = detectPython(file);
|
||||||
process->setCommand({pythonCommand, args});
|
process->setCommand({pythonCommand, args});
|
||||||
process->setWorkingDirectory(workingDir(file));
|
process->setWorkingDirectory(workingDir(file));
|
||||||
|
@@ -287,7 +287,7 @@ public:
|
|||||||
~LinuxDevicePrivate();
|
~LinuxDevicePrivate();
|
||||||
|
|
||||||
CommandLine fullLocalCommandLine(const CommandLine &remoteCommand,
|
CommandLine fullLocalCommandLine(const CommandLine &remoteCommand,
|
||||||
QtcProcess::TerminalMode terminalMode,
|
TerminalMode terminalMode,
|
||||||
bool hasDisplay) const;
|
bool hasDisplay) const;
|
||||||
bool setupShell();
|
bool setupShell();
|
||||||
bool runInShell(const CommandLine &cmd, const QByteArray &data = {});
|
bool runInShell(const CommandLine &cmd, const QByteArray &data = {});
|
||||||
@@ -335,7 +335,7 @@ LinuxDevice::LinuxDevice()
|
|||||||
if (env.size() > 0)
|
if (env.size() > 0)
|
||||||
proc->setCommand({"/bin/sh", {}});
|
proc->setCommand({"/bin/sh", {}});
|
||||||
|
|
||||||
proc->setTerminalMode(QtcProcess::TerminalOn);
|
proc->setTerminalMode(TerminalMode::On);
|
||||||
proc->setEnvironment(env);
|
proc->setEnvironment(env);
|
||||||
proc->setWorkingDirectory(workingDir);
|
proc->setWorkingDirectory(workingDir);
|
||||||
proc->start();
|
proc->start();
|
||||||
@@ -438,7 +438,7 @@ bool LinuxDevice::handlesFile(const FilePath &filePath) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
CommandLine LinuxDevicePrivate::fullLocalCommandLine(const CommandLine &remoteCommand,
|
CommandLine LinuxDevicePrivate::fullLocalCommandLine(const CommandLine &remoteCommand,
|
||||||
QtcProcess::TerminalMode terminalMode,
|
TerminalMode terminalMode,
|
||||||
bool hasDisplay) const
|
bool hasDisplay) const
|
||||||
{
|
{
|
||||||
Utils::CommandLine cmd{SshSettings::sshFilePath()};
|
Utils::CommandLine cmd{SshSettings::sshFilePath()};
|
||||||
@@ -446,7 +446,7 @@ CommandLine LinuxDevicePrivate::fullLocalCommandLine(const CommandLine &remoteCo
|
|||||||
|
|
||||||
if (hasDisplay)
|
if (hasDisplay)
|
||||||
cmd.addArg("-X");
|
cmd.addArg("-X");
|
||||||
if (terminalMode != QtcProcess::TerminalOff)
|
if (terminalMode != TerminalMode::Off)
|
||||||
cmd.addArg("-tt");
|
cmd.addArg("-tt");
|
||||||
|
|
||||||
cmd.addArg("-q");
|
cmd.addArg("-q");
|
||||||
|
@@ -12,6 +12,7 @@ add_qtc_executable(qtcreator_processlauncher
|
|||||||
processlauncher-main.cpp
|
processlauncher-main.cpp
|
||||||
${UTILSDIR}/launcherpackets.cpp
|
${UTILSDIR}/launcherpackets.cpp
|
||||||
${UTILSDIR}/launcherpackets.h
|
${UTILSDIR}/launcherpackets.h
|
||||||
|
${UTILSDIR}/processenums.h
|
||||||
${UTILSDIR}/processreaper.cpp
|
${UTILSDIR}/processreaper.cpp
|
||||||
${UTILSDIR}/processreaper.h
|
${UTILSDIR}/processreaper.h
|
||||||
${UTILSDIR}/processutils.cpp
|
${UTILSDIR}/processutils.cpp
|
||||||
|
@@ -29,6 +29,7 @@ QtcTool {
|
|||||||
files: [
|
files: [
|
||||||
"launcherpackets.cpp",
|
"launcherpackets.cpp",
|
||||||
"launcherpackets.h",
|
"launcherpackets.h",
|
||||||
|
"processenums.h",
|
||||||
"processreaper.cpp",
|
"processreaper.cpp",
|
||||||
"processreaper.h",
|
"processreaper.h",
|
||||||
"processutils.cpp",
|
"processutils.cpp",
|
||||||
|
Reference in New Issue
Block a user