From b2dc5e11baa1e6bbdc9eadab5caabc1ab670ac92 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Date: Wed, 3 Mar 2010 15:30:06 +0100
Subject: [PATCH] Symbian: make sis failed when make.exe is not in path.

Reviewed-by: con
---
 .../qt-s60/s60devicerunconfiguration.cpp        | 17 ++++++++++-------
 .../qt-s60/s60devicerunconfiguration.h          |  3 ++-
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
index 119eabdbd95..7a943e79d04 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
+++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
@@ -585,10 +585,11 @@ S60DeviceRunControlBase::S60DeviceRunControlBase(RunConfiguration *runConfigurat
     // 'sis' is a make target. Set up with correct environment
     // Also add $QTDIR/bin, since it needs to find 'createpackage'.
     ProjectExplorer::ToolChain *toolchain = activeBuildConf->toolChain();
-    m_makeTool = toolchain->makeCommand();
     ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment();
     toolchain->addToEnvironment(env);
     env.prependOrSetPath(m_qtBinPath);
+    // Windows: Use the make.exe from epoc32\tools
+    m_makeTool = env.searchInPath(toolchain->makeCommand());
     m_makesisProcess->setEnvironment(env.toStringList());
     m_executableFileName = s60runConfig->localExecutableFileName();
     m_packageFilePath = s60runConfig->packageFileName();
@@ -731,7 +732,7 @@ void S60DeviceRunControlBase::readStandardOutput()
 
 void S60DeviceRunControlBase::makesisProcessFailed()
 {
-    processFailed(m_makeTool, m_makesisProcess->error());
+    processFailed(m_makeTool, m_makesisProcess->error(), m_makesisProcess->errorString());
 }
 
 static inline bool renameFile(const QString &sourceName, const QString &targetName,
@@ -949,20 +950,22 @@ void S60DeviceRunControlBase::slotWaitingForTrkClosed()
     }
 }
 
-void S60DeviceRunControlBase::processFailed(const QString &program, QProcess::ProcessError errorCode)
+void S60DeviceRunControlBase::processFailed(const QString &program,
+                                            QProcess::ProcessError errorCode,
+                                            const QString &msg)
 {
     QString errorString;
     switch (errorCode) {
     case QProcess::FailedToStart:
-        errorString = tr("Failed to start %1.");
+        errorString = tr("Failed to start %1: %2").arg(program, msg);
         break;
     case QProcess::Crashed:
-        errorString = tr("%1 has unexpectedly finished.");
+        errorString = tr("%1 has unexpectedly finished: %2").arg(program, msg);
         break;
     default:
-        errorString = tr("An error has occurred while running %1.");
+        errorString = tr("An error has occurred while running %1: %2").arg(program, msg);
     }
-    error(this, errorString.arg(program));
+    error(this, errorString);
     stop();
     emit finished();
 }
diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h
index d9429f87861..ed5d9a400e0 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h
+++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h
@@ -177,7 +177,8 @@ public:
 protected:
     virtual void initLauncher(const QString &executable, trk::Launcher *) = 0;
     virtual void handleLauncherFinished() = 0;
-    void processFailed(const QString &program, QProcess::ProcessError errorCode);
+    void processFailed(const QString &program, QProcess::ProcessError errorCode,
+                       const QString &msg);
 
     virtual bool checkConfiguration(QString *errorMessage,
                                     QString *settingsCategory,
-- 
GitLab