forked from qt-creator/qt-creator
ApplicationLauncher: Cleanup
Get rid of public msgWinCannotRetrieveDebuggingOutput() method, as it was used interally in Windows case only. Get rid of m_listeningPid field, as that's the same what applicationPID() returns. Change-Id: I8bfac790f0d363e6f7cc12012597c7b8aaad6d92 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -107,8 +107,6 @@ public:
|
|||||||
// 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;
|
||||||
|
|
||||||
qint64 m_listeningPid = 0;
|
|
||||||
|
|
||||||
// Remote
|
// Remote
|
||||||
QString m_remoteErrorString;
|
QString m_remoteErrorString;
|
||||||
QProcess::ProcessError m_remoteError = QProcess::UnknownError;
|
QProcess::ProcessError m_remoteError = QProcess::UnknownError;
|
||||||
@@ -180,7 +178,6 @@ void ApplicationLauncherPrivate::stop()
|
|||||||
if (!isRunning())
|
if (!isRunning())
|
||||||
return;
|
return;
|
||||||
QTC_ASSERT(m_process, return);
|
QTC_ASSERT(m_process, return);
|
||||||
m_listeningPid = 0;
|
|
||||||
m_process->stopProcess();
|
m_process->stopProcess();
|
||||||
QTimer::singleShot(100, this, [this] { emit q->finished(); });
|
QTimer::singleShot(100, this, [this] { emit q->finished(); });
|
||||||
} else {
|
} else {
|
||||||
@@ -249,7 +246,6 @@ void ApplicationLauncherPrivate::handleLocalDone()
|
|||||||
if (error == QProcess::UnknownError) {
|
if (error == QProcess::UnknownError) {
|
||||||
m_exitCode = m_process->exitCode();
|
m_exitCode = m_process->exitCode();
|
||||||
m_exitStatus = m_process->exitStatus();
|
m_exitStatus = m_process->exitStatus();
|
||||||
m_listeningPid = 0;
|
|
||||||
emit q->finished();
|
emit q->finished();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -304,21 +300,17 @@ void ApplicationLauncherPrivate::cannotRetrieveLocalDebugOutput()
|
|||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
disconnect(WinDebugInterface::instance(), nullptr, this, nullptr);
|
disconnect(WinDebugInterface::instance(), nullptr, this, nullptr);
|
||||||
emit q->appendMessage(ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput(), ErrorMessageFormat);
|
emit q->appendMessage(ApplicationLauncher::tr("Cannot retrieve debugging output.")
|
||||||
|
+ QLatin1Char('\n'), ErrorMessageFormat);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplicationLauncherPrivate::checkLocalDebugOutput(qint64 pid, const QString &message)
|
void ApplicationLauncherPrivate::checkLocalDebugOutput(qint64 pid, const QString &message)
|
||||||
{
|
{
|
||||||
if (m_listeningPid == pid)
|
if (applicationPID() == pid)
|
||||||
emit q->appendMessage(message, DebugFormat);
|
emit q->appendMessage(message, DebugFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput()
|
|
||||||
{
|
|
||||||
return tr("Cannot retrieve debugging output.") + QLatin1Char('\n');
|
|
||||||
}
|
|
||||||
|
|
||||||
int ApplicationLauncher::exitCode() const
|
int ApplicationLauncher::exitCode() const
|
||||||
{
|
{
|
||||||
return d->m_exitCode;
|
return d->m_exitCode;
|
||||||
@@ -411,12 +403,7 @@ void ApplicationLauncherPrivate::start()
|
|||||||
else
|
else
|
||||||
m_outputCodec = QTextCodec::codecForName("utf8");
|
m_outputCodec = QTextCodec::codecForName("utf8");
|
||||||
|
|
||||||
connect(m_process.get(), &QtcProcess::started, this, [this] {
|
connect(m_process.get(), &QtcProcess::started, q, &ApplicationLauncher::started);
|
||||||
// The local bit affects only WinDebugInterface.
|
|
||||||
if (m_isLocal)
|
|
||||||
m_listeningPid = applicationPID();
|
|
||||||
emit q->started();
|
|
||||||
});
|
|
||||||
|
|
||||||
m_process->setProcessChannelMode(m_processChannelMode);
|
m_process->setProcessChannelMode(m_processChannelMode);
|
||||||
if (m_processChannelMode == QProcess::SeparateChannels) {
|
if (m_processChannelMode == QProcess::SeparateChannels) {
|
||||||
|
@@ -64,8 +64,6 @@ public:
|
|||||||
QString errorString() const;
|
QString errorString() const;
|
||||||
QProcess::ProcessError error() const;
|
QProcess::ProcessError error() const;
|
||||||
|
|
||||||
static QString msgWinCannotRetrieveDebuggingOutput();
|
|
||||||
|
|
||||||
int exitCode() const;
|
int exitCode() const;
|
||||||
QProcess::ExitStatus exitStatus() const;
|
QProcess::ExitStatus exitStatus() const;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user