Drop QFileInfo::exists() check before trying to run an executable

Physical existence of a file is not strictly needed for something
being runnable, e.g. 'foo' can be used to start a process on windows,
even when only 'foo.exe', but not 'foo' itself exists.

On the other hand, the existence of the file is not sufficient either
to run it, so the check was too weak and too strict at the same time.

Change-Id: I4a41d2f5cbb0cb471023a8bc23628072b28a5984
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2018-03-20 08:05:19 +01:00
parent 80f98a7fb9
commit 5d79e1dcee

View File

@@ -1572,9 +1572,6 @@ void SimpleTargetRunner::start()
const QString executable = m_runnable.as<StandardRunnable>().executable; const QString executable = m_runnable.as<StandardRunnable>().executable;
if (executable.isEmpty()) { if (executable.isEmpty()) {
reportFailure(RunControl::tr("No executable specified.")); reportFailure(RunControl::tr("No executable specified."));
} else if (!QFileInfo::exists(executable)) {
reportFailure(RunControl::tr("Executable %1 does not exist.")
.arg(QDir::toNativeSeparators(executable)));
} else { } else {
m_launcher.start(m_runnable); m_launcher.start(m_runnable);
} }