forked from qt-creator/qt-creator
Final step to be able to set remote environment.
Task-number: QTCREATORBUG-1663 Reviewed-by: ck
This commit is contained in:
@@ -52,5 +52,14 @@ QString MaemoGlobal::remoteCommandPrefix(const QString &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 Qt4ProjectManager
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define MAEMOGLOBAL_H
|
||||
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/environment.h>
|
||||
|
||||
#include <QtCore/QList>
|
||||
|
||||
@@ -47,6 +48,7 @@ public:
|
||||
static QString homeDirOnDevice(const QString &uname);
|
||||
static QString remoteSudo();
|
||||
static QString remoteCommandPrefix(const QString &commandFilePath);
|
||||
static QString remoteEnvironment(const QList<ProjectExplorer::EnvironmentItem> &list);
|
||||
|
||||
template<class T> static T *buildStep(const ProjectExplorer::BuildConfiguration *bc)
|
||||
{
|
||||
|
||||
@@ -113,8 +113,10 @@ void MaemoRunControl::startExecution()
|
||||
{
|
||||
emit appendMessage(this, tr("Starting remote process ..."), false);
|
||||
const QString &remoteExe = m_runConfig->remoteExecutableFilePath();
|
||||
m_runner->startExecution(QString::fromLocal8Bit("%1 %2 %3")
|
||||
.arg(MaemoGlobal::remoteCommandPrefix(remoteExe)).arg(remoteExe)
|
||||
m_runner->startExecution(QString::fromLocal8Bit("%1 %2 %3 %4")
|
||||
.arg(MaemoGlobal::remoteCommandPrefix(remoteExe))
|
||||
.arg(MaemoGlobal::remoteEnvironment(m_runConfig->userEnvironmentChanges()))
|
||||
.arg(remoteExe)
|
||||
.arg(m_runConfig->arguments().join(QLatin1String(" "))).toUtf8());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user