forked from qt-creator/qt-creator
Introduce the concept of a "device process".
Provide a QProcess-like abstraction that can be used
to implement processes running locally or on a remote
device. Objects of a concrete class implementing the functionality
are created by IDevice objects.
Current implementations are:
- Local execution (QProcess-based), provided via the DesktopDevice.
- Remote execution via SSH.
- A specialized case of the former for remote Linux systems (provided by
LinuxDevice).
The latter is already being used in a number of places. As a result, lots of
code dealing with details such as setting the remote environment could be
moved to a central location. These things are no longer the concern of whoever
is wishing to run a remote process.
Change-Id: I919260ee6e77a020ca47226a4a534e7b8398106f
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "qnxconstants.h"
|
||||
|
||||
#include <remotelinux/remotelinuxrunconfigurationwidget.h>
|
||||
#include <utils/environment.h>
|
||||
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
@@ -60,22 +61,14 @@ void QnxRunConfiguration::setQtLibPath(const QString &path)
|
||||
m_qtLibPath = path;
|
||||
}
|
||||
|
||||
QString QnxRunConfiguration::environmentPreparationCommand() const
|
||||
Utils::Environment QnxRunConfiguration::environment() const
|
||||
{
|
||||
QString command;
|
||||
const QStringList filesToSource = QStringList() << QLatin1String("/etc/profile")
|
||||
<< QLatin1String("$HOME/.profile");
|
||||
foreach (const QString &filePath, filesToSource)
|
||||
command += QString::fromLatin1("test -f %1 && . %1;").arg(filePath);
|
||||
if (!workingDirectory().isEmpty())
|
||||
command += QLatin1String("cd ") + workingDirectory() + QLatin1Char(';');
|
||||
|
||||
if (!m_qtLibPath.isEmpty())
|
||||
command += QLatin1String("LD_LIBRARY_PATH=") + m_qtLibPath + QLatin1String(":$LD_LIBRARY_PATH");
|
||||
else
|
||||
command.chop(1); // Trailing semicolon.
|
||||
|
||||
return command;
|
||||
Utils::Environment env = RemoteLinuxRunConfiguration::environment();
|
||||
if (!m_qtLibPath.isEmpty()) {
|
||||
env.appendOrSet(QLatin1String("LD_LIBRARY_PATH"),
|
||||
m_qtLibPath + QLatin1String(":$LD_LIBRARY_PATH"));
|
||||
}
|
||||
return env;
|
||||
}
|
||||
|
||||
QWidget *QnxRunConfiguration::createConfigurationWidget()
|
||||
|
||||
Reference in New Issue
Block a user