Skip to content
Snippets Groups Projects
Commit 4a16cb9c authored by kh1's avatar kh1
Browse files

Final step to be able to set remote environment.

Task-number: QTCREATORBUG-1663
Reviewed-by: ck
parent ebe2fb88
No related branches found
No related tags found
No related merge requests found
...@@ -52,5 +52,14 @@ QString MaemoGlobal::remoteCommandPrefix(const QString &commandFilePath) ...@@ -52,5 +52,14 @@ QString MaemoGlobal::remoteCommandPrefix(const QString &commandFilePath)
.arg(remoteSudo()).arg(commandFilePath); .arg(remoteSudo()).arg(commandFilePath);
} }
QString MaemoGlobal::remoteEnvironment(const QList<ProjectExplorer::EnvironmentItem> &list)
{
QString env;
QString placeHolder = QLatin1String("%1=%2 ");
foreach (const ProjectExplorer::EnvironmentItem &item, list)
env.append(placeHolder.arg(item.name).arg(item.value));
return env.mid(0, env.size() - 1);
}
} // namespace Internal } // namespace Internal
} // namespace Qt4ProjectManager } // namespace Qt4ProjectManager
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#define MAEMOGLOBAL_H #define MAEMOGLOBAL_H
#include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/environment.h>
#include <QtCore/QList> #include <QtCore/QList>
...@@ -47,6 +48,7 @@ public: ...@@ -47,6 +48,7 @@ public:
static QString homeDirOnDevice(const QString &uname); static QString homeDirOnDevice(const QString &uname);
static QString remoteSudo(); static QString remoteSudo();
static QString remoteCommandPrefix(const QString &commandFilePath); static QString remoteCommandPrefix(const QString &commandFilePath);
static QString remoteEnvironment(const QList<ProjectExplorer::EnvironmentItem> &list);
template<class T> static T *buildStep(const ProjectExplorer::BuildConfiguration *bc) template<class T> static T *buildStep(const ProjectExplorer::BuildConfiguration *bc)
{ {
......
...@@ -113,8 +113,10 @@ void MaemoRunControl::startExecution() ...@@ -113,8 +113,10 @@ void MaemoRunControl::startExecution()
{ {
emit appendMessage(this, tr("Starting remote process ..."), false); emit appendMessage(this, tr("Starting remote process ..."), false);
const QString &remoteExe = m_runConfig->remoteExecutableFilePath(); const QString &remoteExe = m_runConfig->remoteExecutableFilePath();
m_runner->startExecution(QString::fromLocal8Bit("%1 %2 %3") m_runner->startExecution(QString::fromLocal8Bit("%1 %2 %3 %4")
.arg(MaemoGlobal::remoteCommandPrefix(remoteExe)).arg(remoteExe) .arg(MaemoGlobal::remoteCommandPrefix(remoteExe))
.arg(MaemoGlobal::remoteEnvironment(m_runConfig->userEnvironmentChanges()))
.arg(remoteExe)
.arg(m_runConfig->arguments().join(QLatin1String(" "))).toUtf8()); .arg(m_runConfig->arguments().join(QLatin1String(" "))).toUtf8());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment