forked from qt-creator/qt-creator
ApplicationLauncher: Get rid of m_useTerminal field
Change-Id: Iab77cf695c1d21cf0e89a230f76ad129757ffb5b Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -100,8 +100,6 @@ public:
|
|||||||
QTextCodec::ConverterState m_outputCodecState;
|
QTextCodec::ConverterState m_outputCodecState;
|
||||||
QTextCodec::ConverterState m_errorCodecState;
|
QTextCodec::ConverterState m_errorCodecState;
|
||||||
|
|
||||||
// Local
|
|
||||||
bool m_useTerminal = false;
|
|
||||||
// Keep track whether we need to emit a finished signal
|
// Keep track whether we need to emit a finished signal
|
||||||
bool m_processRunning = false;
|
bool m_processRunning = false;
|
||||||
|
|
||||||
@@ -156,7 +154,7 @@ void ApplicationLauncher::setProcessChannelMode(QProcess::ProcessChannelMode mod
|
|||||||
|
|
||||||
void ApplicationLauncher::setUseTerminal(bool on)
|
void ApplicationLauncher::setUseTerminal(bool on)
|
||||||
{
|
{
|
||||||
d->m_useTerminal = on;
|
d->m_process->setTerminalMode(on ? Utils::TerminalMode::On : Utils::TerminalMode::Off);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplicationLauncher::setRunAsRoot(bool on)
|
void ApplicationLauncher::setRunAsRoot(bool on)
|
||||||
@@ -249,7 +247,7 @@ void ApplicationLauncherPrivate::handleDone()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// TODO: why below handlings are different?
|
// TODO: why below handlings are different?
|
||||||
if (m_useTerminal) {
|
if (m_process->usesTerminal()) {
|
||||||
emit q->appendMessage(m_process->errorString(), ErrorMessageFormat);
|
emit q->appendMessage(m_process->errorString(), ErrorMessageFormat);
|
||||||
if (m_processRunning && m_process->processId() == 0) {
|
if (m_processRunning && m_process->processId() == 0) {
|
||||||
m_processRunning = false;
|
m_processRunning = false;
|
||||||
@@ -409,7 +407,6 @@ void ApplicationLauncherPrivate::start()
|
|||||||
else
|
else
|
||||||
m_outputCodec = QTextCodec::codecForName("utf8");
|
m_outputCodec = QTextCodec::codecForName("utf8");
|
||||||
|
|
||||||
m_process->setTerminalMode(m_useTerminal ? Utils::TerminalMode::On : Utils::TerminalMode::Off);
|
|
||||||
m_process->start();
|
m_process->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user