aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/tools/launcherinterface.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-10-10 14:47:51 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2017-10-11 13:42:46 +0000
commitd749ce52378ca13d4a3d4952991e6e743085a135 (patch)
treea82646e737c8a1d6b87988cd7cb80ff66d1549fa /src/lib/corelib/tools/launcherinterface.cpp
parenta63f034c73bc7534c31fdfd892a9b666e96e2cdb (diff)
Emit better error message if process launcher fails to start
We now tell the user that starting the launcher already failed and where we expected the launcher to be. Task-number: QBS-1210 Change-Id: I4fab1963735219515cbafb2b01d5992ee124d00c Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/lib/corelib/tools/launcherinterface.cpp')
-rw-r--r--src/lib/corelib/tools/launcherinterface.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/corelib/tools/launcherinterface.cpp b/src/lib/corelib/tools/launcherinterface.cpp
index 9c6b2eb68..97f1c62ee 100644
--- a/src/lib/corelib/tools/launcherinterface.cpp
+++ b/src/lib/corelib/tools/launcherinterface.cpp
@@ -47,6 +47,7 @@
#include <QtCore/qcoreapplication.h>
#include <QtCore/qdebug.h>
+#include <QtCore/qdir.h>
#include <QtCore/qprocess.h>
#include <QtNetwork/qlocalserver.h>
@@ -146,8 +147,12 @@ void LauncherInterface::handleNewConnection()
void LauncherInterface::handleProcessError()
{
- if (m_process->error() == QProcess::FailedToStart)
- handleProcessFinished();
+ if (m_process->error() == QProcess::FailedToStart) {
+ const QString launcherPathForUser
+ = QDir::toNativeSeparators(QDir::cleanPath(m_process->program()));
+ emit errorOccurred(ErrorInfo(Tr::tr("Failed to start process launcher at '%1': %2")
+ .arg(launcherPathForUser, m_process->errorString())));
+ }
}
void LauncherInterface::handleProcessFinished()