ConsoleProcess: Silence some compiler warnings

Change-Id: Ia143eccfeafcbadff82653a59c201ae9d98e0499
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Ulf Hermann
2018-09-06 15:10:47 +02:00
parent 4425d15550
commit c771928f53

View File

@@ -123,7 +123,7 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
stubServerShutdown(); stubServerShutdown();
emitError(QProcess::FailedToStart, msgCannotCreateTempFile(d->m_tempFile->errorString())); emitError(QProcess::FailedToStart, msgCannotCreateTempFile(d->m_tempFile->errorString()));
delete d->m_tempFile; delete d->m_tempFile;
d->m_tempFile = 0; d->m_tempFile = nullptr;
return false; return false;
} }
QByteArray contents; QByteArray contents;
@@ -135,7 +135,7 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
stubServerShutdown(); stubServerShutdown();
emitError(QProcess::FailedToStart, msgCannotWriteTempFile()); emitError(QProcess::FailedToStart, msgCannotWriteTempFile());
delete d->m_tempFile; delete d->m_tempFile;
d->m_tempFile = 0; d->m_tempFile = nullptr;
return false; return false;
} }
} }
@@ -159,7 +159,7 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
emitError(QProcess::UnknownError, tr("Cannot start the terminal emulator \"%1\", change the setting in the " emitError(QProcess::UnknownError, tr("Cannot start the terminal emulator \"%1\", change the setting in the "
"Environment options.").arg(terminal.command)); "Environment options.").arg(terminal.command));
delete d->m_tempFile; delete d->m_tempFile;
d->m_tempFile = 0; d->m_tempFile = nullptr;
return false; return false;
} }
d->m_stubConnectTimer = new QTimer(this); d->m_stubConnectTimer = new QTimer(this);
@@ -252,7 +252,7 @@ void ConsoleProcess::stubServerShutdown()
d->m_stubSocket->disconnect(); // avoid getting queued readyRead signals d->m_stubSocket->disconnect(); // avoid getting queued readyRead signals
d->m_stubSocket->deleteLater(); // we might be called from the disconnected signal of m_stubSocket d->m_stubSocket->deleteLater(); // we might be called from the disconnected signal of m_stubSocket
} }
d->m_stubSocket = 0; d->m_stubSocket = nullptr;
if (d->m_stubServer.isListening()) { if (d->m_stubServer.isListening()) {
d->m_stubServer.close(); d->m_stubServer.close();
::rmdir(d->m_stubServerDir.constData()); ::rmdir(d->m_stubServerDir.constData());
@@ -263,7 +263,7 @@ void ConsoleProcess::stubConnectionAvailable()
{ {
if (d->m_stubConnectTimer) { if (d->m_stubConnectTimer) {
delete d->m_stubConnectTimer; delete d->m_stubConnectTimer;
d->m_stubConnectTimer = 0; d->m_stubConnectTimer = nullptr;
} }
d->m_stubConnected = true; d->m_stubConnected = true;
emit stubStarted(); emit stubStarted();
@@ -288,7 +288,7 @@ void ConsoleProcess::readStubOutput()
emitError(QProcess::FailedToStart, msgCannotExecute(d->m_executable, errorMsg(out.mid(9).toInt()))); emitError(QProcess::FailedToStart, msgCannotExecute(d->m_executable, errorMsg(out.mid(9).toInt())));
} else if (out.startsWith("spid ")) { } else if (out.startsWith("spid ")) {
delete d->m_tempFile; delete d->m_tempFile;
d->m_tempFile = 0; d->m_tempFile = nullptr;
d->m_stubPid = out.mid(4).toInt(); d->m_stubPid = out.mid(4).toInt();
} else if (out.startsWith("pid ")) { } else if (out.startsWith("pid ")) {
@@ -321,7 +321,7 @@ void ConsoleProcess::stubExited()
stubServerShutdown(); stubServerShutdown();
d->m_stubPid = 0; d->m_stubPid = 0;
delete d->m_tempFile; delete d->m_tempFile;
d->m_tempFile = 0; d->m_tempFile = nullptr;
if (d->m_appPid) { if (d->m_appPid) {
d->m_appStatus = QProcess::CrashExit; d->m_appStatus = QProcess::CrashExit;
d->m_appCode = -1; d->m_appCode = -1;
@@ -438,6 +438,7 @@ bool ConsoleProcess::startTerminalEmulator(QSettings *settings, const QString &w
const TerminalCommand term = terminalEmulator(settings); const TerminalCommand term = terminalEmulator(settings);
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
// for 5.9 and below we cannot set the environment // for 5.9 and below we cannot set the environment
Q_UNUSED(env);
return QProcess::startDetached(term.command, QtcProcess::splitArgs(term.openArgs), return QProcess::startDetached(term.command, QtcProcess::splitArgs(term.openArgs),
workingDir); workingDir);
#else #else