forked from qt-creator/qt-creator
overhaul process argument handling
get away from argument stringlists. instead, use native shell command lines which support quoting/splitting, environment variable expansion and redirections with well-understood semantics. Task-number: QTCREATORBUG-542 Task-number: QTCREATORBUG-1564
This commit is contained in:
@@ -32,6 +32,8 @@
|
|||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
|
#include "environment.h"
|
||||||
|
|
||||||
#include <QtCore/QStringList>
|
#include <QtCore/QStringList>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
@@ -45,10 +47,10 @@ public:
|
|||||||
QString workingDirectory() const { return m_workingDir; }
|
QString workingDirectory() const { return m_workingDir; }
|
||||||
void setWorkingDirectory(const QString &dir) { m_workingDir = dir; }
|
void setWorkingDirectory(const QString &dir) { m_workingDir = dir; }
|
||||||
|
|
||||||
QStringList environment() const { return m_environment; }
|
void setEnvironment(const Environment &env) { m_environment = env; }
|
||||||
void setEnvironment(const QStringList &env) { m_environment = env; }
|
Environment environment() const { return m_environment; }
|
||||||
|
|
||||||
virtual bool start(const QString &program, const QStringList &args) = 0;
|
virtual bool start(const QString &program, const QString &args) = 0;
|
||||||
virtual void stop() = 0;
|
virtual void stop() = 0;
|
||||||
|
|
||||||
virtual bool isRunning() const = 0;
|
virtual bool isRunning() const = 0;
|
||||||
@@ -63,14 +65,15 @@ public:
|
|||||||
static QStringList fixWinEnvironment(const QStringList &env);
|
static QStringList fixWinEnvironment(const QStringList &env);
|
||||||
// Quote a Windows command line correctly for the "CreateProcess" API
|
// Quote a Windows command line correctly for the "CreateProcess" API
|
||||||
static QString createWinCommandline(const QString &program, const QStringList &args);
|
static QString createWinCommandline(const QString &program, const QStringList &args);
|
||||||
|
static QString createWinCommandline(const QString &program, const QString &args);
|
||||||
// Create a bytearray suitable to be passed on as environment
|
// Create a bytearray suitable to be passed on as environment
|
||||||
// to the "CreateProcess" API (0-terminated UTF 16 strings).
|
// to the "CreateProcess" API (0-terminated UTF 16 strings).
|
||||||
static QByteArray createWinEnvironment(const QStringList &env);
|
static QByteArray createWinEnvironment(const QStringList &env);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
QString m_workingDir;
|
QString m_workingDir;
|
||||||
QStringList m_environment;
|
Environment m_environment;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace Utils
|
} //namespace Utils
|
||||||
|
@@ -51,49 +51,57 @@ QStringList AbstractProcess::fixWinEnvironment(const QStringList &env)
|
|||||||
return envStrings;
|
return envStrings;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AbstractProcess::createWinCommandline(const QString &program, const QStringList &args)
|
static QString quoteWinCommand(const QString &program)
|
||||||
{
|
{
|
||||||
const QChar doubleQuote = QLatin1Char('"');
|
const QChar doubleQuote = QLatin1Char('"');
|
||||||
const QChar blank = QLatin1Char(' ');
|
|
||||||
const QChar backSlash = QLatin1Char('\\');
|
|
||||||
|
|
||||||
|
// add the programm as the first arg ... it works better
|
||||||
QString programName = program;
|
QString programName = program;
|
||||||
if (!programName.startsWith(doubleQuote) && !programName.endsWith(doubleQuote) && programName.contains(blank)) {
|
programName.replace(QLatin1Char('/'), QLatin1Char('\\'));
|
||||||
programName.insert(0, doubleQuote);
|
if (!programName.startsWith(doubleQuote) && !programName.endsWith(doubleQuote)
|
||||||
|
&& programName.contains(QLatin1Char(' '))) {
|
||||||
|
programName.prepend(doubleQuote);
|
||||||
programName.append(doubleQuote);
|
programName.append(doubleQuote);
|
||||||
}
|
}
|
||||||
// add the prgram as the first arrg ... it works better
|
return programName;
|
||||||
programName.replace(QLatin1Char('/'), backSlash);
|
}
|
||||||
QString cmdLine = programName;
|
|
||||||
if (args.empty())
|
|
||||||
return cmdLine;
|
|
||||||
|
|
||||||
cmdLine += blank;
|
static QString quoteWinArgument(const QString &arg)
|
||||||
for (int i = 0; i < args.size(); ++i) {
|
{
|
||||||
QString tmp = args.at(i);
|
if (!arg.length())
|
||||||
// in the case of \" already being in the string the \ must also be escaped
|
return QString::fromLatin1("\"\"");
|
||||||
tmp.replace(QLatin1String("\\\""), QLatin1String("\\\\\""));
|
|
||||||
// escape a single " because the arguments will be parsed
|
QString ret(arg);
|
||||||
tmp.replace(QString(doubleQuote), QLatin1String("\\\""));
|
// Quotes are escaped and their preceding backslashes are doubled.
|
||||||
if (tmp.isEmpty() || tmp.contains(blank) || tmp.contains('\t')) {
|
ret.replace(QRegExp(QLatin1String("(\\\\*)\"")), QLatin1String("\\1\\1\\\""));
|
||||||
// The argument must not end with a \ since this would be interpreted
|
if (ret.contains(QRegExp(QLatin1String("\\s")))) {
|
||||||
// as escaping the quote -- rather put the \ behind the quote: e.g.
|
// The argument must not end with a \ since this would be interpreted
|
||||||
// rather use "foo"\ than "foo\"
|
// as escaping the quote -- rather put the \ behind the quote: e.g.
|
||||||
QString endQuote(doubleQuote);
|
// rather use "foo"\ than "foo\"
|
||||||
int i = tmp.length();
|
ret.replace(QRegExp(QLatin1String("(\\\\*)$")), QLatin1String("\"\\1"));
|
||||||
while (i > 0 && tmp.at(i - 1) == backSlash) {
|
ret.prepend(QLatin1Char('"'));
|
||||||
--i;
|
|
||||||
endQuote += backSlash;
|
|
||||||
}
|
|
||||||
cmdLine += QLatin1String(" \"");
|
|
||||||
cmdLine += tmp.left(i);
|
|
||||||
cmdLine += endQuote;
|
|
||||||
} else {
|
|
||||||
cmdLine += blank;
|
|
||||||
cmdLine += tmp;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return cmdLine;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AbstractProcess::createWinCommandline(const QString &program, const QStringList &args)
|
||||||
|
{
|
||||||
|
QString programName = quoteWinCommand(program);
|
||||||
|
foreach (const QString &arg, args) {
|
||||||
|
programName += QLatin1Char(' ');
|
||||||
|
programName += quoteWinArgument(arg);
|
||||||
|
}
|
||||||
|
return programName;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AbstractProcess::createWinCommandline(const QString &program, const QString &args)
|
||||||
|
{
|
||||||
|
QString programName = quoteWinCommand(program);
|
||||||
|
if (!args.isEmpty()) {
|
||||||
|
programName += QLatin1Char(' ');
|
||||||
|
programName += args;
|
||||||
|
}
|
||||||
|
return programName;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray AbstractProcess::createWinEnvironment(const QStringList &env)
|
QByteArray AbstractProcess::createWinEnvironment(const QStringList &env)
|
||||||
|
@@ -54,7 +54,7 @@ public:
|
|||||||
ConsoleProcess(QObject *parent = 0);
|
ConsoleProcess(QObject *parent = 0);
|
||||||
~ConsoleProcess();
|
~ConsoleProcess();
|
||||||
|
|
||||||
bool start(const QString &program, const QStringList &args);
|
bool start(const QString &program, const QString &args);
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
void setMode(Mode m);
|
void setMode(Mode m);
|
||||||
|
@@ -29,6 +29,9 @@
|
|||||||
|
|
||||||
#include "consoleprocess.h"
|
#include "consoleprocess.h"
|
||||||
|
|
||||||
|
#include "environment.h"
|
||||||
|
#include "qtcprocess.h"
|
||||||
|
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QSettings>
|
#include <QtCore/QSettings>
|
||||||
@@ -66,6 +69,7 @@ ConsoleProcessPrivate::ConsoleProcessPrivate() :
|
|||||||
m_mode(ConsoleProcess::Run),
|
m_mode(ConsoleProcess::Run),
|
||||||
m_appPid(0),
|
m_appPid(0),
|
||||||
m_stubSocket(0),
|
m_stubSocket(0),
|
||||||
|
m_tempFile(0),
|
||||||
m_settings(0)
|
m_settings(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -114,18 +118,49 @@ void ConsoleProcess::setSettings(QSettings *settings)
|
|||||||
d->m_settings = settings;
|
d->m_settings = settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConsoleProcess::start(const QString &program, const QStringList &args)
|
bool ConsoleProcess::start(const QString &program, const QString &args)
|
||||||
{
|
{
|
||||||
if (isRunning())
|
if (isRunning())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
QtcProcess::SplitError perr;
|
||||||
|
QStringList pargs = QtcProcess::prepareArgs(args, &perr, &m_environment, &m_workingDir);
|
||||||
|
QString pcmd;
|
||||||
|
if (perr == QtcProcess::SplitOk) {
|
||||||
|
pcmd = program;
|
||||||
|
} else {
|
||||||
|
if (perr != QtcProcess::FoundMeta) {
|
||||||
|
emit processMessage(tr("Quoting error in command."), true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (d->m_mode == Debug) {
|
||||||
|
// FIXME: QTCREATORBUG-2809
|
||||||
|
emit processMessage(tr("Debugging complex shell commands in a terminal"
|
||||||
|
" is currently not supported."), true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
pcmd = QLatin1String("/bin/sh");
|
||||||
|
pargs << QLatin1String("-c") << (QtcProcess::quoteArg(program) + QLatin1Char(' ') + args);
|
||||||
|
}
|
||||||
|
|
||||||
|
QtcProcess::SplitError qerr;
|
||||||
|
QStringList xtermArgs = QtcProcess::prepareArgs(terminalEmulator(d->m_settings), &qerr,
|
||||||
|
&m_environment, &m_workingDir);
|
||||||
|
if (qerr != QtcProcess::SplitOk) {
|
||||||
|
emit processMessage(qerr == QtcProcess::BadQuoting
|
||||||
|
? tr("Quoting error in terminal command.")
|
||||||
|
: tr("Terminal command may not be a shell command."), true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const QString err = stubServerListen();
|
const QString err = stubServerListen();
|
||||||
if (!err.isEmpty()) {
|
if (!err.isEmpty()) {
|
||||||
emit processMessage(msgCommChannelFailed(err), true);
|
emit processMessage(msgCommChannelFailed(err), true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!environment().isEmpty()) {
|
QStringList env = m_environment.toStringList();
|
||||||
|
if (!env.isEmpty()) {
|
||||||
d->m_tempFile = new QTemporaryFile();
|
d->m_tempFile = new QTemporaryFile();
|
||||||
if (!d->m_tempFile->open()) {
|
if (!d->m_tempFile->open()) {
|
||||||
stubServerShutdown();
|
stubServerShutdown();
|
||||||
@@ -134,14 +169,13 @@ bool ConsoleProcess::start(const QString &program, const QStringList &args)
|
|||||||
d->m_tempFile = 0;
|
d->m_tempFile = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
foreach (const QString &var, environment()) {
|
foreach (const QString &var, env) {
|
||||||
d->m_tempFile->write(var.toLocal8Bit());
|
d->m_tempFile->write(var.toLocal8Bit());
|
||||||
d->m_tempFile->write("", 1);
|
d->m_tempFile->write("", 1);
|
||||||
}
|
}
|
||||||
d->m_tempFile->flush();
|
d->m_tempFile->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList xtermArgs = terminalEmulator(d->m_settings).split(QLatin1Char(' ')); // FIXME: quoting
|
|
||||||
xtermArgs
|
xtermArgs
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
<< (QCoreApplication::applicationDirPath() + QLatin1String("/../Resources/qtcreator_process_stub"))
|
<< (QCoreApplication::applicationDirPath() + QLatin1String("/../Resources/qtcreator_process_stub"))
|
||||||
@@ -153,7 +187,7 @@ bool ConsoleProcess::start(const QString &program, const QStringList &args)
|
|||||||
<< msgPromptToClose()
|
<< msgPromptToClose()
|
||||||
<< workingDirectory()
|
<< workingDirectory()
|
||||||
<< (d->m_tempFile ? d->m_tempFile->fileName() : QString())
|
<< (d->m_tempFile ? d->m_tempFile->fileName() : QString())
|
||||||
<< program << args;
|
<< pcmd << pargs;
|
||||||
|
|
||||||
QString xterm = xtermArgs.takeFirst();
|
QString xterm = xtermArgs.takeFirst();
|
||||||
d->m_process.start(xterm, xtermArgs);
|
d->m_process.start(xterm, xtermArgs);
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "consoleprocess.h"
|
#include "consoleprocess.h"
|
||||||
|
#include "environment.h"
|
||||||
|
#include "qtcprocess.h"
|
||||||
#include "winutils.h"
|
#include "winutils.h"
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@@ -115,18 +117,28 @@ QProcess::ExitStatus ConsoleProcess::exitStatus() const
|
|||||||
return d->m_appStatus;
|
return d->m_appStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConsoleProcess::start(const QString &program, const QStringList &args)
|
bool ConsoleProcess::start(const QString &program, const QString &args)
|
||||||
{
|
{
|
||||||
if (isRunning())
|
if (isRunning())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
QString pcmd;
|
||||||
|
QString pargs;
|
||||||
|
if (d->m_mode != Run) { // The debugger engines already pre-process the arguments.
|
||||||
|
pcmd = program;
|
||||||
|
pargs = args;
|
||||||
|
} else {
|
||||||
|
QtcProcess::prepareCommand(program, args, &pcmd, &pargs, &m_environment, &m_workingDir);
|
||||||
|
}
|
||||||
|
|
||||||
const QString err = stubServerListen();
|
const QString err = stubServerListen();
|
||||||
if (!err.isEmpty()) {
|
if (!err.isEmpty()) {
|
||||||
emit processMessage(msgCommChannelFailed(err), true);
|
emit processMessage(msgCommChannelFailed(err), true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!environment().isEmpty()) {
|
QStringList env = m_environment.toStringList();
|
||||||
|
if (!env.isEmpty()) {
|
||||||
d->m_tempFile = new QTemporaryFile();
|
d->m_tempFile = new QTemporaryFile();
|
||||||
if (!d->m_tempFile->open()) {
|
if (!d->m_tempFile->open()) {
|
||||||
stubServerShutdown();
|
stubServerShutdown();
|
||||||
@@ -138,7 +150,7 @@ bool ConsoleProcess::start(const QString &program, const QStringList &args)
|
|||||||
QTextStream out(d->m_tempFile);
|
QTextStream out(d->m_tempFile);
|
||||||
out.setCodec("UTF-16LE");
|
out.setCodec("UTF-16LE");
|
||||||
out.setGenerateByteOrderMark(false);
|
out.setGenerateByteOrderMark(false);
|
||||||
foreach (const QString &var, fixWinEnvironment(environment()))
|
foreach (const QString &var, fixWinEnvironment(env))
|
||||||
out << var << QChar(0);
|
out << var << QChar(0);
|
||||||
out << QChar(0);
|
out << QChar(0);
|
||||||
}
|
}
|
||||||
@@ -159,7 +171,7 @@ bool ConsoleProcess::start(const QString &program, const QStringList &args)
|
|||||||
<< d->m_stubServer.fullServerName()
|
<< d->m_stubServer.fullServerName()
|
||||||
<< workDir
|
<< workDir
|
||||||
<< (d->m_tempFile ? d->m_tempFile->fileName() : 0)
|
<< (d->m_tempFile ? d->m_tempFile->fileName() : 0)
|
||||||
<< createWinCommandline(program, args)
|
<< createWinCommandline(pcmd, pargs)
|
||||||
<< msgPromptToClose();
|
<< msgPromptToClose();
|
||||||
|
|
||||||
const QString cmdLine = createWinCommandline(
|
const QString cmdLine = createWinCommandline(
|
||||||
|
@@ -332,62 +332,6 @@ bool Environment::operator==(const Environment &other) const
|
|||||||
return m_values == other.m_values;
|
return m_values == other.m_values;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList Environment::parseCombinedArgString(const QString &program)
|
|
||||||
{
|
|
||||||
QStringList args;
|
|
||||||
QString tmp;
|
|
||||||
int quoteCount = 0;
|
|
||||||
bool inQuote = false;
|
|
||||||
|
|
||||||
// handle quoting. tokens can be surrounded by double quotes
|
|
||||||
// "hello world". three consecutive double quotes represent
|
|
||||||
// the quote character itself.
|
|
||||||
for (int i = 0; i < program.size(); ++i) {
|
|
||||||
if (program.at(i) == QLatin1Char('"')) {
|
|
||||||
++quoteCount;
|
|
||||||
if (quoteCount == 3) {
|
|
||||||
// third consecutive quote
|
|
||||||
quoteCount = 0;
|
|
||||||
tmp += program.at(i);
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (quoteCount) {
|
|
||||||
if (quoteCount == 1)
|
|
||||||
inQuote = !inQuote;
|
|
||||||
quoteCount = 0;
|
|
||||||
}
|
|
||||||
if (!inQuote && program.at(i).isSpace()) {
|
|
||||||
if (!tmp.isEmpty()) {
|
|
||||||
args += tmp;
|
|
||||||
tmp.clear();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tmp += program.at(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!tmp.isEmpty())
|
|
||||||
args += tmp;
|
|
||||||
return args;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString Environment::joinArgumentList(const QStringList &arguments)
|
|
||||||
{
|
|
||||||
QString result;
|
|
||||||
const QChar doubleQuote = QLatin1Char('"');
|
|
||||||
foreach (QString arg, arguments) {
|
|
||||||
if (!result.isEmpty())
|
|
||||||
result += QLatin1Char(' ');
|
|
||||||
arg.replace(QString(doubleQuote), QLatin1String("\"\"\""));
|
|
||||||
if (arg.contains(QLatin1Char(' '))) {
|
|
||||||
arg.insert(0, doubleQuote);
|
|
||||||
arg += doubleQuote;
|
|
||||||
}
|
|
||||||
result += arg;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Expand environment variables in a string.
|
/** Expand environment variables in a string.
|
||||||
*
|
*
|
||||||
* Environment variables are accepted in the following forms:
|
* Environment variables are accepted in the following forms:
|
||||||
|
@@ -94,9 +94,6 @@ public:
|
|||||||
const QStringList & additionalDirs = QStringList()) const;
|
const QStringList & additionalDirs = QStringList()) const;
|
||||||
QStringList path() const;
|
QStringList path() const;
|
||||||
|
|
||||||
static QStringList parseCombinedArgString(const QString &program);
|
|
||||||
static QString joinArgumentList(const QStringList &arguments);
|
|
||||||
|
|
||||||
QString expandVariables(const QString &) const;
|
QString expandVariables(const QString &) const;
|
||||||
QStringList expandVariables(const QStringList &) const;
|
QStringList expandVariables(const QStringList &) const;
|
||||||
|
|
||||||
|
@@ -243,7 +243,7 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer:
|
|||||||
|
|
||||||
MakeStep *cleanMakeStep = new MakeStep(cleanSteps);
|
MakeStep *cleanMakeStep = new MakeStep(cleanSteps);
|
||||||
cleanSteps->insertStep(0, cleanMakeStep);
|
cleanSteps->insertStep(0, cleanMakeStep);
|
||||||
cleanMakeStep->setAdditionalArguments(QStringList() << "clean");
|
cleanMakeStep->setAdditionalArguments("clean");
|
||||||
cleanMakeStep->setClean(true);
|
cleanMakeStep->setClean(true);
|
||||||
|
|
||||||
CMakeOpenProjectWizard copw(cmtarget->cmakeProject()->projectManager(),
|
CMakeOpenProjectWizard copw(cmtarget->cmakeProject()->projectManager(),
|
||||||
|
@@ -202,12 +202,12 @@ void CMakeOpenProjectWizard::setMsvcVersion(const QString &version)
|
|||||||
m_msvcVersion = version;
|
m_msvcVersion = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList CMakeOpenProjectWizard::arguments() const
|
QString CMakeOpenProjectWizard::arguments() const
|
||||||
{
|
{
|
||||||
return m_arguments;
|
return m_arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeOpenProjectWizard::setArguments(const QStringList &args)
|
void CMakeOpenProjectWizard::setArguments(const QString &args)
|
||||||
{
|
{
|
||||||
m_arguments = args;
|
m_arguments = args;
|
||||||
}
|
}
|
||||||
@@ -426,7 +426,6 @@ void CMakeRunPage::runCMake()
|
|||||||
{
|
{
|
||||||
m_runCMake->setEnabled(false);
|
m_runCMake->setEnabled(false);
|
||||||
m_argumentsLineEdit->setEnabled(false);
|
m_argumentsLineEdit->setEnabled(false);
|
||||||
QStringList arguments = Utils::Environment::parseCombinedArgString(m_argumentsLineEdit->text());
|
|
||||||
CMakeManager *cmakeManager = m_cmakeWizard->cmakeManager();
|
CMakeManager *cmakeManager = m_cmakeWizard->cmakeManager();
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
@@ -464,11 +463,11 @@ void CMakeRunPage::runCMake()
|
|||||||
m_output->clear();
|
m_output->clear();
|
||||||
|
|
||||||
if (m_cmakeWizard->cmakeManager()->isCMakeExecutableValid()) {
|
if (m_cmakeWizard->cmakeManager()->isCMakeExecutableValid()) {
|
||||||
m_cmakeProcess = new QProcess();
|
m_cmakeProcess = new Utils::QtcProcess();
|
||||||
connect(m_cmakeProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(cmakeReadyReadStandardOutput()));
|
connect(m_cmakeProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(cmakeReadyReadStandardOutput()));
|
||||||
connect(m_cmakeProcess, SIGNAL(readyReadStandardError()), this, SLOT(cmakeReadyReadStandardError()));
|
connect(m_cmakeProcess, SIGNAL(readyReadStandardError()), this, SLOT(cmakeReadyReadStandardError()));
|
||||||
connect(m_cmakeProcess, SIGNAL(finished(int)), this, SLOT(cmakeFinished()));
|
connect(m_cmakeProcess, SIGNAL(finished(int)), this, SLOT(cmakeFinished()));
|
||||||
cmakeManager->createXmlFile(m_cmakeProcess, arguments, m_cmakeWizard->sourceDirectory(), m_buildDirectory, env, generator);
|
cmakeManager->createXmlFile(m_cmakeProcess, m_argumentsLineEdit->text(), m_cmakeWizard->sourceDirectory(), m_buildDirectory, env, generator);
|
||||||
} else {
|
} else {
|
||||||
m_runCMake->setEnabled(true);
|
m_runCMake->setEnabled(true);
|
||||||
m_argumentsLineEdit->setEnabled(true);
|
m_argumentsLineEdit->setEnabled(true);
|
||||||
@@ -522,7 +521,7 @@ void CMakeRunPage::cmakeFinished()
|
|||||||
}
|
}
|
||||||
m_cmakeProcess->deleteLater();
|
m_cmakeProcess->deleteLater();
|
||||||
m_cmakeProcess = 0;
|
m_cmakeProcess = 0;
|
||||||
m_cmakeWizard->setArguments(Utils::Environment::parseCombinedArgString(m_argumentsLineEdit->text()));
|
m_cmakeWizard->setArguments(m_argumentsLineEdit->text());
|
||||||
//TODO Actually test that running cmake was finished, for setting this bool
|
//TODO Actually test that running cmake was finished, for setting this bool
|
||||||
emit completeChanged();
|
emit completeChanged();
|
||||||
}
|
}
|
||||||
|
@@ -32,8 +32,8 @@
|
|||||||
|
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/wizard.h>
|
#include <utils/wizard.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QtCore/QProcess>
|
|
||||||
#include <QtGui/QPushButton>
|
#include <QtGui/QPushButton>
|
||||||
#include <QtGui/QComboBox>
|
#include <QtGui/QComboBox>
|
||||||
#include <QtGui/QLineEdit>
|
#include <QtGui/QLineEdit>
|
||||||
@@ -81,8 +81,8 @@ public:
|
|||||||
QString sourceDirectory() const;
|
QString sourceDirectory() const;
|
||||||
void setBuildDirectory(const QString &directory);
|
void setBuildDirectory(const QString &directory);
|
||||||
CMakeManager *cmakeManager() const;
|
CMakeManager *cmakeManager() const;
|
||||||
QStringList arguments() const;
|
QString arguments() const;
|
||||||
void setArguments(const QStringList &args);
|
void setArguments(const QString &args);
|
||||||
Utils::Environment environment() const;
|
Utils::Environment environment() const;
|
||||||
QString msvcVersion() const;
|
QString msvcVersion() const;
|
||||||
void setMsvcVersion(const QString &version);
|
void setMsvcVersion(const QString &version);
|
||||||
@@ -93,7 +93,7 @@ private:
|
|||||||
CMakeManager *m_cmakeManager;
|
CMakeManager *m_cmakeManager;
|
||||||
QString m_buildDirectory;
|
QString m_buildDirectory;
|
||||||
QString m_sourceDirectory;
|
QString m_sourceDirectory;
|
||||||
QStringList m_arguments;
|
QString m_arguments;
|
||||||
QString m_msvcVersion;
|
QString m_msvcVersion;
|
||||||
bool m_creatingCbpFiles;
|
bool m_creatingCbpFiles;
|
||||||
Utils::Environment m_environment;
|
Utils::Environment m_environment;
|
||||||
@@ -140,7 +140,7 @@ private:
|
|||||||
CMakeOpenProjectWizard *m_cmakeWizard;
|
CMakeOpenProjectWizard *m_cmakeWizard;
|
||||||
QPlainTextEdit *m_output;
|
QPlainTextEdit *m_output;
|
||||||
QPushButton *m_runCMake;
|
QPushButton *m_runCMake;
|
||||||
QProcess *m_cmakeProcess;
|
Utils::QtcProcess *m_cmakeProcess;
|
||||||
QLineEdit *m_argumentsLineEdit;
|
QLineEdit *m_argumentsLineEdit;
|
||||||
Utils::PathChooser *m_cmakeExecutable;
|
Utils::PathChooser *m_cmakeExecutable;
|
||||||
QComboBox *m_generatorComboBox;
|
QComboBox *m_generatorComboBox;
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#include "cmakeproject.h"
|
#include "cmakeproject.h"
|
||||||
|
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
#include <coreplugin/uniqueidmanager.h>
|
||||||
@@ -102,7 +103,7 @@ bool CMakeManager::hasCodeBlocksMsvcGenerator() const
|
|||||||
// we probably want the process instead of this function
|
// we probably want the process instead of this function
|
||||||
// cmakeproject then could even run the cmake process in the background, adding the files afterwards
|
// cmakeproject then could even run the cmake process in the background, adding the files afterwards
|
||||||
// sounds like a plan
|
// sounds like a plan
|
||||||
void CMakeManager::createXmlFile(QProcess *proc, const QStringList &arguments,
|
void CMakeManager::createXmlFile(Utils::QtcProcess *proc, const QString &arguments,
|
||||||
const QString &sourceDirectory, const QDir &buildDirectory,
|
const QString &sourceDirectory, const QDir &buildDirectory,
|
||||||
const Utils::Environment &env, const QString &generator)
|
const Utils::Environment &env, const QString &generator)
|
||||||
{
|
{
|
||||||
@@ -117,11 +118,16 @@ void CMakeManager::createXmlFile(QProcess *proc, const QStringList &arguments,
|
|||||||
QString buildDirectoryPath = buildDirectory.absolutePath();
|
QString buildDirectoryPath = buildDirectory.absolutePath();
|
||||||
buildDirectory.mkpath(buildDirectoryPath);
|
buildDirectory.mkpath(buildDirectoryPath);
|
||||||
proc->setWorkingDirectory(buildDirectoryPath);
|
proc->setWorkingDirectory(buildDirectoryPath);
|
||||||
proc->setEnvironment(env.toStringList());
|
proc->setEnvironment(env);
|
||||||
|
|
||||||
const QString srcdir = buildDirectory.exists(QLatin1String("CMakeCache.txt")) ?
|
const QString srcdir = buildDirectory.exists(QLatin1String("CMakeCache.txt")) ?
|
||||||
QString(QLatin1Char('.')) : sourceDirectory;
|
QString(QLatin1Char('.')) : sourceDirectory;
|
||||||
proc->start(cmakeExecutable(), QStringList() << srcdir << arguments << generator);
|
QString args;
|
||||||
|
Utils::QtcProcess::addArg(&args, srcdir);
|
||||||
|
Utils::QtcProcess::addArgs(&args, arguments);
|
||||||
|
Utils::QtcProcess::addArg(&args, generator);
|
||||||
|
proc->setCommand(cmakeExecutable(), args);
|
||||||
|
proc->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CMakeManager::findCbpFile(const QDir &directory)
|
QString CMakeManager::findCbpFile(const QDir &directory)
|
||||||
|
@@ -44,6 +44,10 @@
|
|||||||
QT_FORWARD_DECLARE_CLASS(QProcess)
|
QT_FORWARD_DECLARE_CLASS(QProcess)
|
||||||
QT_FORWARD_DECLARE_CLASS(QLabel)
|
QT_FORWARD_DECLARE_CLASS(QLabel)
|
||||||
|
|
||||||
|
namespace Utils {
|
||||||
|
class QtcProcess;
|
||||||
|
}
|
||||||
|
|
||||||
namespace CMakeProjectManager {
|
namespace CMakeProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -66,8 +70,8 @@ public:
|
|||||||
|
|
||||||
void setCMakeExecutable(const QString &executable);
|
void setCMakeExecutable(const QString &executable);
|
||||||
|
|
||||||
void createXmlFile(QProcess *process,
|
void createXmlFile(Utils::QtcProcess *process,
|
||||||
const QStringList &arguments,
|
const QString &arguments,
|
||||||
const QString &sourceDirectory,
|
const QString &sourceDirectory,
|
||||||
const QDir &buildDirectory,
|
const QDir &buildDirectory,
|
||||||
const Utils::Environment &env,
|
const Utils::Environment &env,
|
||||||
|
@@ -141,14 +141,9 @@ QString CMakeRunConfiguration::baseWorkingDirectory() const
|
|||||||
return m_workingDirectory;
|
return m_workingDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList CMakeRunConfiguration::commandLineArguments() const
|
QString CMakeRunConfiguration::commandLineArguments() const
|
||||||
{
|
{
|
||||||
return environment().expandVariables(baseCommandLineArguments());
|
return m_arguments;
|
||||||
}
|
|
||||||
|
|
||||||
QStringList CMakeRunConfiguration::baseCommandLineArguments() const
|
|
||||||
{
|
|
||||||
return Utils::Environment::parseCombinedArgString(m_arguments);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CMakeRunConfiguration::title() const
|
QString CMakeRunConfiguration::title() const
|
||||||
@@ -329,7 +324,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
|
|||||||
fl->setMargin(0);
|
fl->setMargin(0);
|
||||||
fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
||||||
QLineEdit *argumentsLineEdit = new QLineEdit();
|
QLineEdit *argumentsLineEdit = new QLineEdit();
|
||||||
argumentsLineEdit->setText(Utils::Environment::joinArgumentList(cmakeRunConfiguration->baseCommandLineArguments()));
|
argumentsLineEdit->setText(cmakeRunConfiguration->commandLineArguments());
|
||||||
connect(argumentsLineEdit, SIGNAL(textChanged(QString)),
|
connect(argumentsLineEdit, SIGNAL(textChanged(QString)),
|
||||||
this, SLOT(setArguments(QString)));
|
this, SLOT(setArguments(QString)));
|
||||||
fl->addRow(tr("Arguments:"), argumentsLineEdit);
|
fl->addRow(tr("Arguments:"), argumentsLineEdit);
|
||||||
|
@@ -68,7 +68,7 @@ public:
|
|||||||
QString executable() const;
|
QString executable() const;
|
||||||
RunMode runMode() const;
|
RunMode runMode() const;
|
||||||
QString workingDirectory() const;
|
QString workingDirectory() const;
|
||||||
QStringList commandLineArguments() const;
|
QString commandLineArguments() const;
|
||||||
Utils::Environment environment() const;
|
Utils::Environment environment() const;
|
||||||
QWidget *createConfigurationWidget();
|
QWidget *createConfigurationWidget();
|
||||||
|
|
||||||
@@ -104,7 +104,6 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void setUserWorkingDirectory(const QString &workingDirectory);
|
void setUserWorkingDirectory(const QString &workingDirectory);
|
||||||
QString baseWorkingDirectory() const;
|
QString baseWorkingDirectory() const;
|
||||||
QStringList baseCommandLineArguments() const;
|
|
||||||
void ctor();
|
void ctor();
|
||||||
|
|
||||||
enum BaseEnvironmentBase { CleanEnvironmentBase = 0,
|
enum BaseEnvironmentBase { CleanEnvironmentBase = 0,
|
||||||
|
@@ -209,7 +209,7 @@ CMakeTarget *CMakeTargetFactory::create(ProjectExplorer::Project *parent, const
|
|||||||
|
|
||||||
MakeStep *cleanMakeStep = new MakeStep(cleanSteps);
|
MakeStep *cleanMakeStep = new MakeStep(cleanSteps);
|
||||||
cleanSteps->insertStep(0, cleanMakeStep);
|
cleanSteps->insertStep(0, cleanMakeStep);
|
||||||
cleanMakeStep->setAdditionalArguments(QStringList() << "clean");
|
cleanMakeStep->setAdditionalArguments("clean");
|
||||||
cleanMakeStep->setClean(true);
|
cleanMakeStep->setClean(true);
|
||||||
|
|
||||||
t->addBuildConfiguration(bc);
|
t->addBuildConfiguration(bc);
|
||||||
|
@@ -39,6 +39,8 @@
|
|||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/gnumakeparser.h>
|
#include <projectexplorer/gnumakeparser.h>
|
||||||
|
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QtGui/QFormLayout>
|
#include <QtGui/QFormLayout>
|
||||||
#include <QtGui/QGroupBox>
|
#include <QtGui/QGroupBox>
|
||||||
#include <QtGui/QCheckBox>
|
#include <QtGui/QCheckBox>
|
||||||
@@ -78,7 +80,7 @@ MakeStep::MakeStep(BuildStepList *bsl, MakeStep *bs) :
|
|||||||
m_clean(bs->m_clean),
|
m_clean(bs->m_clean),
|
||||||
m_futureInterface(0),
|
m_futureInterface(0),
|
||||||
m_buildTargets(bs->m_buildTargets),
|
m_buildTargets(bs->m_buildTargets),
|
||||||
m_additionalArguments(bs->m_buildTargets)
|
m_additionalArguments(Utils::QtcProcess::joinArgs(bs->m_buildTargets))
|
||||||
{
|
{
|
||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
@@ -117,7 +119,7 @@ bool MakeStep::fromMap(const QVariantMap &map)
|
|||||||
{
|
{
|
||||||
m_clean = map.value(QLatin1String(CLEAN_KEY)).toBool();
|
m_clean = map.value(QLatin1String(CLEAN_KEY)).toBool();
|
||||||
m_buildTargets = map.value(QLatin1String(BUILD_TARGETS_KEY)).toStringList();
|
m_buildTargets = map.value(QLatin1String(BUILD_TARGETS_KEY)).toStringList();
|
||||||
m_additionalArguments = map.value(QLatin1String(ADDITIONAL_ARGUMENTS_KEY)).toStringList();
|
m_additionalArguments = map.value(QLatin1String(ADDITIONAL_ARGUMENTS_KEY)).toString();
|
||||||
|
|
||||||
return BuildStep::fromMap(map);
|
return BuildStep::fromMap(map);
|
||||||
}
|
}
|
||||||
@@ -132,8 +134,8 @@ bool MakeStep::init()
|
|||||||
|
|
||||||
setCommand(bc->toolChain()->makeCommand());
|
setCommand(bc->toolChain()->makeCommand());
|
||||||
|
|
||||||
QStringList arguments = m_buildTargets;
|
QString arguments = Utils::QtcProcess::joinArgs(m_buildTargets);
|
||||||
arguments << additionalArguments();
|
Utils::QtcProcess::addArgs(&arguments, additionalArguments());
|
||||||
setArguments(arguments);
|
setArguments(arguments);
|
||||||
setEnvironment(bc->environment());
|
setEnvironment(bc->environment());
|
||||||
setIgnoreReturnValue(m_clean);
|
setIgnoreReturnValue(m_clean);
|
||||||
@@ -191,12 +193,12 @@ void MakeStep::setBuildTarget(const QString &buildTarget, bool on)
|
|||||||
m_buildTargets = old;
|
m_buildTargets = old;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList MakeStep::additionalArguments() const
|
QString MakeStep::additionalArguments() const
|
||||||
{
|
{
|
||||||
return m_additionalArguments;
|
return m_additionalArguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStep::setAdditionalArguments(const QStringList &list)
|
void MakeStep::setAdditionalArguments(const QString &list)
|
||||||
{
|
{
|
||||||
m_additionalArguments = list;
|
m_additionalArguments = list;
|
||||||
}
|
}
|
||||||
@@ -239,7 +241,7 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
|
|||||||
|
|
||||||
void MakeStepConfigWidget::additionalArgumentsEdited()
|
void MakeStepConfigWidget::additionalArgumentsEdited()
|
||||||
{
|
{
|
||||||
m_makeStep->setAdditionalArguments(Utils::Environment::parseCombinedArgString(m_additionalArguments->text()));
|
m_makeStep->setAdditionalArguments(m_additionalArguments->text());
|
||||||
updateDetails();
|
updateDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,7 +268,7 @@ void MakeStepConfigWidget::init()
|
|||||||
// and connect again
|
// and connect again
|
||||||
connect(m_buildTargetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
|
connect(m_buildTargetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
|
||||||
|
|
||||||
m_additionalArguments->setText(Utils::Environment::joinArgumentList(m_makeStep->additionalArguments()));
|
m_additionalArguments->setText(m_makeStep->additionalArguments());
|
||||||
updateDetails();
|
updateDetails();
|
||||||
|
|
||||||
CMakeProject *pro = m_makeStep->cmakeBuildConfiguration()->cmakeTarget()->cmakeProject();
|
CMakeProject *pro = m_makeStep->cmakeBuildConfiguration()->cmakeTarget()->cmakeProject();
|
||||||
@@ -290,13 +292,13 @@ void MakeStepConfigWidget::buildTargetsChanged()
|
|||||||
|
|
||||||
void MakeStepConfigWidget::updateDetails()
|
void MakeStepConfigWidget::updateDetails()
|
||||||
{
|
{
|
||||||
QStringList arguments = m_makeStep->m_buildTargets;
|
QString arguments = Utils::QtcProcess::joinArgs(m_makeStep->m_buildTargets);
|
||||||
arguments << m_makeStep->additionalArguments();
|
Utils::QtcProcess::addArgs(&arguments, m_makeStep->additionalArguments());
|
||||||
|
|
||||||
CMakeBuildConfiguration *bc = m_makeStep->cmakeBuildConfiguration();
|
CMakeBuildConfiguration *bc = m_makeStep->cmakeBuildConfiguration();
|
||||||
ProjectExplorer::ToolChain *tc = bc->toolChain();
|
ProjectExplorer::ToolChain *tc = bc->toolChain();
|
||||||
if (tc)
|
if (tc)
|
||||||
m_summaryText = tr("<b>Make:</b> %1 %2").arg(tc->makeCommand(), arguments.join(QString(QLatin1Char(' '))));
|
m_summaryText = tr("<b>Make:</b> %1 %2").arg(tc->makeCommand(), arguments);
|
||||||
else
|
else
|
||||||
m_summaryText = tr("<b>Unknown Toolchain</b>");
|
m_summaryText = tr("<b>Unknown Toolchain</b>");
|
||||||
emit updateSummary();
|
emit updateSummary();
|
||||||
|
@@ -65,8 +65,8 @@ public:
|
|||||||
virtual bool immutable() const;
|
virtual bool immutable() const;
|
||||||
bool buildsBuildTarget(const QString &target) const;
|
bool buildsBuildTarget(const QString &target) const;
|
||||||
void setBuildTarget(const QString &target, bool on);
|
void setBuildTarget(const QString &target, bool on);
|
||||||
QStringList additionalArguments() const;
|
QString additionalArguments() const;
|
||||||
void setAdditionalArguments(const QStringList &list);
|
void setAdditionalArguments(const QString &list);
|
||||||
|
|
||||||
void setClean(bool clean);
|
void setClean(bool clean);
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ private:
|
|||||||
QRegExp m_percentProgress;
|
QRegExp m_percentProgress;
|
||||||
QFutureInterface<bool> *m_futureInterface;
|
QFutureInterface<bool> *m_futureInterface;
|
||||||
QStringList m_buildTargets;
|
QStringList m_buildTargets;
|
||||||
QStringList m_additionalArguments;
|
QString m_additionalArguments;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MakeStepConfigWidget :public ProjectExplorer::BuildStepConfigWidget
|
class MakeStepConfigWidget :public ProjectExplorer::BuildStepConfigWidget
|
||||||
|
@@ -56,6 +56,7 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/winutils.h>
|
#include <utils/winutils.h>
|
||||||
#include <utils/consoleprocess.h>
|
#include <utils/consoleprocess.h>
|
||||||
#include <utils/fancymainwindow.h>
|
#include <utils/fancymainwindow.h>
|
||||||
@@ -464,7 +465,17 @@ void CdbEngine::runEngine()
|
|||||||
needWatchTimer = true; // Fetch away module load, etc. even if crashed
|
needWatchTimer = true; // Fetch away module load, etc. even if crashed
|
||||||
break;
|
break;
|
||||||
case StartInternal:
|
case StartInternal:
|
||||||
case StartExternal:
|
case StartExternal: {
|
||||||
|
Utils::QtcProcess::SplitError perr;
|
||||||
|
QString pargs = Utils::QtcProcess::prepareArgs(sp.processArgs, &perr,
|
||||||
|
&sp.environment, &sp.workingDirectory);
|
||||||
|
if (perr != Utils::QtcProcess::SplitOk) {
|
||||||
|
// perr == BadQuoting is never returned on Windows
|
||||||
|
// FIXME? QTCREATORBUG-2809
|
||||||
|
errorMessage = QApplication::translate("DebuggerEngine", // Same message in GdbEngine
|
||||||
|
"Debugging complex command lines is currently not supported under Windows");
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (sp.useTerminal) {
|
if (sp.useTerminal) {
|
||||||
// Attaching to console processes triggers an initial breakpoint, which we do not want
|
// Attaching to console processes triggers an initial breakpoint, which we do not want
|
||||||
m_d->m_ignoreInitialBreakPoint = true;
|
m_d->m_ignoreInitialBreakPoint = true;
|
||||||
@@ -472,7 +483,7 @@ void CdbEngine::runEngine()
|
|||||||
m_d->m_consoleStubProc.stop(); // We leave the console open, so recycle it now.
|
m_d->m_consoleStubProc.stop(); // We leave the console open, so recycle it now.
|
||||||
m_d->m_consoleStubProc.setWorkingDirectory(sp.workingDirectory);
|
m_d->m_consoleStubProc.setWorkingDirectory(sp.workingDirectory);
|
||||||
m_d->m_consoleStubProc.setEnvironment(sp.environment);
|
m_d->m_consoleStubProc.setEnvironment(sp.environment);
|
||||||
rc = m_d->m_consoleStubProc.start(sp.executable, sp.processArgs);
|
rc = m_d->m_consoleStubProc.start(sp.executable, pargs);
|
||||||
if (!rc)
|
if (!rc)
|
||||||
errorMessage = tr("The console stub process was unable to start '%1'.").arg(sp.executable);
|
errorMessage = tr("The console stub process was unable to start '%1'.").arg(sp.executable);
|
||||||
// continues in slotConsoleStubStarted()...
|
// continues in slotConsoleStubStarted()...
|
||||||
@@ -480,11 +491,11 @@ void CdbEngine::runEngine()
|
|||||||
needWatchTimer = true;
|
needWatchTimer = true;
|
||||||
rc = m_d->startDebuggerWithExecutable(sp.workingDirectory,
|
rc = m_d->startDebuggerWithExecutable(sp.workingDirectory,
|
||||||
sp.executable,
|
sp.executable,
|
||||||
sp.processArgs,
|
pargs,
|
||||||
sp.environment,
|
sp.environment.toStringList(),
|
||||||
&errorMessage);
|
&errorMessage);
|
||||||
}
|
}
|
||||||
break;
|
break; }
|
||||||
case AttachCore:
|
case AttachCore:
|
||||||
errorMessage = tr("Attaching to core files is not supported.");
|
errorMessage = tr("Attaching to core files is not supported.");
|
||||||
break;
|
break;
|
||||||
|
@@ -465,7 +465,7 @@ void CoreEngine::resetModuleLoadTimer()
|
|||||||
|
|
||||||
bool CoreEngine::startDebuggerWithExecutable(const QString &workingDirectory,
|
bool CoreEngine::startDebuggerWithExecutable(const QString &workingDirectory,
|
||||||
const QString &filename,
|
const QString &filename,
|
||||||
const QStringList &args,
|
const QString &args,
|
||||||
const QStringList &envList,
|
const QStringList &envList,
|
||||||
QString *errorMessage)
|
QString *errorMessage)
|
||||||
{
|
{
|
||||||
|
@@ -86,7 +86,7 @@ public:
|
|||||||
// Start functions
|
// Start functions
|
||||||
bool startDebuggerWithExecutable(const QString &workingDirectory,
|
bool startDebuggerWithExecutable(const QString &workingDirectory,
|
||||||
const QString &filename,
|
const QString &filename,
|
||||||
const QStringList &args,
|
const QString &args,
|
||||||
const QStringList &env,
|
const QStringList &env,
|
||||||
QString *errorMessage);
|
QString *errorMessage);
|
||||||
|
|
||||||
|
@@ -118,10 +118,9 @@ QDebug operator<<(QDebug d, DebuggerState state)
|
|||||||
QDebug operator<<(QDebug str, const DebuggerStartParameters &sp)
|
QDebug operator<<(QDebug str, const DebuggerStartParameters &sp)
|
||||||
{
|
{
|
||||||
QDebug nospace = str.nospace();
|
QDebug nospace = str.nospace();
|
||||||
const QString sep = QString(QLatin1Char(','));
|
|
||||||
nospace << "executable=" << sp.executable
|
nospace << "executable=" << sp.executable
|
||||||
<< " coreFile=" << sp.coreFile
|
<< " coreFile=" << sp.coreFile
|
||||||
<< " processArgs=" << sp.processArgs.join(sep)
|
<< " processArgs=" << sp.processArgs
|
||||||
<< " environment=<" << sp.environment.size() << " variables>"
|
<< " environment=<" << sp.environment.size() << " variables>"
|
||||||
<< " workingDir=" << sp.workingDirectory
|
<< " workingDir=" << sp.workingDirectory
|
||||||
<< " attachPID=" << sp.attachPID
|
<< " attachPID=" << sp.attachPID
|
||||||
@@ -477,8 +476,8 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
|
|||||||
d->m_inferiorPid = d->m_startParameters.attachPID > 0
|
d->m_inferiorPid = d->m_startParameters.attachPID > 0
|
||||||
? d->m_startParameters.attachPID : 0;
|
? d->m_startParameters.attachPID : 0;
|
||||||
|
|
||||||
if (d->m_startParameters.environment.empty())
|
if (!d->m_startParameters.environment.size())
|
||||||
d->m_startParameters.environment = Utils::Environment().toStringList();
|
d->m_startParameters.environment = Utils::Environment();
|
||||||
|
|
||||||
if (d->m_startParameters.breakAtMain)
|
if (d->m_startParameters.breakAtMain)
|
||||||
breakByFunctionMain();
|
breakByFunctionMain();
|
||||||
|
@@ -37,6 +37,8 @@
|
|||||||
|
|
||||||
#include <coreplugin/ssh/sshconnection.h>
|
#include <coreplugin/ssh/sshconnection.h>
|
||||||
|
|
||||||
|
#include <utils/environment.h>
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QStringList>
|
#include <QtCore/QStringList>
|
||||||
|
|
||||||
@@ -70,8 +72,8 @@ public:
|
|||||||
QString displayName;
|
QString displayName;
|
||||||
QString coreFile;
|
QString coreFile;
|
||||||
bool isSnapshot; // set if created internally
|
bool isSnapshot; // set if created internally
|
||||||
QStringList processArgs;
|
QString processArgs;
|
||||||
QStringList environment;
|
Utils::Environment environment;
|
||||||
QString workingDirectory;
|
QString workingDirectory;
|
||||||
qint64 attachPID;
|
qint64 attachPID;
|
||||||
bool useTerminal;
|
bool useTerminal;
|
||||||
|
@@ -2047,10 +2047,9 @@ void DebuggerPluginPrivate::startExternalApplication()
|
|||||||
sp.workingDirectory = dlg.workingDirectory();
|
sp.workingDirectory = dlg.workingDirectory();
|
||||||
sp.breakAtMain = dlg.breakAtMain();
|
sp.breakAtMain = dlg.breakAtMain();
|
||||||
if (!dlg.executableArguments().isEmpty())
|
if (!dlg.executableArguments().isEmpty())
|
||||||
sp.processArgs = dlg.executableArguments().split(QLatin1Char(' '));
|
sp.processArgs = dlg.executableArguments();
|
||||||
// Fixme: 1 of 3 testing hacks.
|
// Fixme: 1 of 3 testing hacks.
|
||||||
if (!sp.processArgs.isEmpty()
|
if (sp.processArgs.startsWith(__("@tcf@ ")) || sp.processArgs.startsWith(__("@sym@ ")))
|
||||||
&& (sp.processArgs.front() == _("@tcf@") || sp.processArgs.front() == _("@sym@")))
|
|
||||||
sp.toolChainType = ProjectExplorer::ToolChain_RVCT_ARMV5;
|
sp.toolChainType = ProjectExplorer::ToolChain_RVCT_ARMV5;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -171,7 +171,7 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
|
|||||||
QTC_ASSERT(rc, return sp);
|
QTC_ASSERT(rc, return sp);
|
||||||
|
|
||||||
sp.startMode = StartInternal;
|
sp.startMode = StartInternal;
|
||||||
sp.environment = rc->environment().toStringList();
|
sp.environment = rc->environment();
|
||||||
sp.workingDirectory = rc->workingDirectory();
|
sp.workingDirectory = rc->workingDirectory();
|
||||||
sp.executable = rc->executable();
|
sp.executable = rc->executable();
|
||||||
sp.processArgs = rc->commandLineArguments();
|
sp.processArgs = rc->commandLineArguments();
|
||||||
@@ -429,7 +429,7 @@ void DebuggerRunControl::createEngine(const DebuggerStartParameters &startParams
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fixme: 1 of 3 testing hacks.
|
// Fixme: 1 of 3 testing hacks.
|
||||||
if (sp.processArgs.size() >= 5 && sp.processArgs.at(0) == _("@tcf@"))
|
if (sp.processArgs.startsWith(__("@tcf@ ")))
|
||||||
engineType = GdbEngineType;
|
engineType = GdbEngineType;
|
||||||
|
|
||||||
if (sp.processArgs.contains( _("@lldb@")))
|
if (sp.processArgs.contains( _("@lldb@")))
|
||||||
@@ -525,7 +525,7 @@ QString DebuggerRunControl::displayName() const
|
|||||||
|
|
||||||
void DebuggerRunControl::setCustomEnvironment(Utils::Environment env)
|
void DebuggerRunControl::setCustomEnvironment(Utils::Environment env)
|
||||||
{
|
{
|
||||||
d->m_engine->startParameters().environment = env.toStringList();
|
d->m_engine->startParameters().environment = env;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DebuggerRunControl::checkDebugConfiguration(int toolChain,
|
bool DebuggerRunControl::checkDebugConfiguration(int toolChain,
|
||||||
|
@@ -32,6 +32,9 @@
|
|||||||
#include "abstractgdbprocess.h"
|
#include "abstractgdbprocess.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QtCore/QProcess>
|
#include <QtCore/QProcess>
|
||||||
|
|
||||||
@@ -74,6 +77,24 @@ bool AbstractGdbAdapter::isTrkAdapter() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
bool AbstractGdbAdapter::prepareWinCommand()
|
||||||
|
{
|
||||||
|
Utils::QtcProcess::SplitError perr;
|
||||||
|
startParameters().processArgs = Utils::QtcProcess::prepareArgs(
|
||||||
|
startParameters().processArgs, &perr,
|
||||||
|
&startParameters().environment, &startParameters().workingDirectory);
|
||||||
|
if (perr != Utils::QtcProcess::SplitOk) {
|
||||||
|
// perr == BadQuoting is never returned on Windows
|
||||||
|
// FIXME? QTCREATORBUG-2809
|
||||||
|
m_engine->handleAdapterStartFailed(QApplication::translate("DebuggerEngine", // Same message in CdbEngine
|
||||||
|
"Debugging complex command lines is currently not supported under Windows"), QString());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
QString AbstractGdbAdapter::msgGdbStopFailed(const QString &why)
|
QString AbstractGdbAdapter::msgGdbStopFailed(const QString &why)
|
||||||
{
|
{
|
||||||
return tr("The Gdb process could not be stopped:\n%1").arg(why);
|
return tr("The Gdb process could not be stopped:\n%1").arg(why);
|
||||||
|
@@ -95,6 +95,9 @@ protected:
|
|||||||
const DebuggerStartParameters &startParameters() const;
|
const DebuggerStartParameters &startParameters() const;
|
||||||
DebuggerStartParameters &startParameters();
|
DebuggerStartParameters &startParameters();
|
||||||
void showMessage(const QString &msg, int channel = LogDebug, int timeout = 1);
|
void showMessage(const QString &msg, int channel = LogDebug, int timeout = 1);
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
bool prepareWinCommand();
|
||||||
|
#endif
|
||||||
|
|
||||||
GdbEngine * const m_engine;
|
GdbEngine * const m_engine;
|
||||||
};
|
};
|
||||||
|
@@ -53,7 +53,7 @@ void AbstractPlainGdbAdapter::setupInferior()
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
|
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
|
||||||
if (!startParameters().processArgs.isEmpty()) {
|
if (!startParameters().processArgs.isEmpty()) {
|
||||||
QString args = startParameters().processArgs.join(_(" "));
|
QString args = startParameters().processArgs;
|
||||||
m_engine->postCommand("-exec-arguments " + toLocalEncoding(args));
|
m_engine->postCommand("-exec-arguments " + toLocalEncoding(args));
|
||||||
}
|
}
|
||||||
m_engine->postCommand("-file-exec-and-symbols \"" + execFilePath() + '"',
|
m_engine->postCommand("-file-exec-and-symbols \"" + execFilePath() + '"',
|
||||||
|
@@ -1708,7 +1708,7 @@ AbstractGdbAdapter *GdbEngine::createAdapter()
|
|||||||
case ProjectExplorer::ToolChain_RVCT_ARMV5_GNUPOC:
|
case ProjectExplorer::ToolChain_RVCT_ARMV5_GNUPOC:
|
||||||
case ProjectExplorer::ToolChain_GCCE_GNUPOC:
|
case ProjectExplorer::ToolChain_GCCE_GNUPOC:
|
||||||
// fixme: 1 of 3 testing hacks
|
// fixme: 1 of 3 testing hacks
|
||||||
if (sp.processArgs.size() >= 5 && sp.processArgs.at(0) == _("@tcf@"))
|
if (sp.processArgs.startsWith(__("@tcf@ ")))
|
||||||
return new TcfTrkGdbAdapter(this);
|
return new TcfTrkGdbAdapter(this);
|
||||||
return new TrkGdbAdapter(this);
|
return new TrkGdbAdapter(this);
|
||||||
default:
|
default:
|
||||||
|
@@ -72,6 +72,11 @@ void LocalPlainGdbAdapter::startAdapter()
|
|||||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||||
showMessage(_("TRYING TO START ADAPTER"));
|
showMessage(_("TRYING TO START ADAPTER"));
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
if (!prepareWinCommand())
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
QStringList gdbArgs;
|
QStringList gdbArgs;
|
||||||
|
|
||||||
if (!m_outputCollector.listen()) {
|
if (!m_outputCollector.listen()) {
|
||||||
@@ -83,8 +88,8 @@ void LocalPlainGdbAdapter::startAdapter()
|
|||||||
|
|
||||||
if (!startParameters().workingDirectory.isEmpty())
|
if (!startParameters().workingDirectory.isEmpty())
|
||||||
m_gdbProc.setWorkingDirectory(startParameters().workingDirectory);
|
m_gdbProc.setWorkingDirectory(startParameters().workingDirectory);
|
||||||
if (!startParameters().environment.isEmpty())
|
if (startParameters().environment.size())
|
||||||
m_gdbProc.setEnvironment(startParameters().environment);
|
m_gdbProc.setEnvironment(startParameters().environment.toStringList());
|
||||||
|
|
||||||
if (!m_engine->startGdb(gdbArgs)) {
|
if (!m_engine->startGdb(gdbArgs)) {
|
||||||
m_outputCollector.shutdown();
|
m_outputCollector.shutdown();
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#include "remoteplaingdbadapter.h"
|
#include "remoteplaingdbadapter.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
|
|
||||||
@@ -143,11 +144,11 @@ void RemoteGdbProcess::handleAppOutputReaderStarted()
|
|||||||
|
|
||||||
connect(m_appOutputReader.data(), SIGNAL(outputAvailable(QByteArray)),
|
connect(m_appOutputReader.data(), SIGNAL(outputAvailable(QByteArray)),
|
||||||
this, SLOT(handleAppOutput(QByteArray)));
|
this, SLOT(handleAppOutput(QByteArray)));
|
||||||
QByteArray cmdLine = "DISPLAY=:0.0 " + m_command.toUtf8() + ' '
|
QByteArray cmdLine = "DISPLAY=:0.0 " + Utils::QtcProcess::quoteArgUnix(m_command).toUtf8() + ' '
|
||||||
+ m_cmdArgs.join(QLatin1String(" ")).toUtf8()
|
+ Utils::QtcProcess::joinArgsUnix(m_cmdArgs).toUtf8()
|
||||||
+ " -tty=" + m_appOutputFileName;
|
+ " -tty=" + m_appOutputFileName;
|
||||||
if (!m_wd.isEmpty())
|
if (!m_wd.isEmpty())
|
||||||
cmdLine.prepend("cd " + m_wd.toUtf8() + " && ");
|
cmdLine.prepend("cd " + Utils::QtcProcess::quoteArgUnix(m_wd).toUtf8() + " && ");
|
||||||
m_gdbProc = m_conn->createRemoteProcess(cmdLine);
|
m_gdbProc = m_conn->createRemoteProcess(cmdLine);
|
||||||
connect(m_gdbProc.data(), SIGNAL(started()), this,
|
connect(m_gdbProc.data(), SIGNAL(started()), this,
|
||||||
SLOT(handleGdbStarted()));
|
SLOT(handleGdbStarted()));
|
||||||
|
@@ -176,7 +176,7 @@ void RemoteGdbServerAdapter::setupInferior()
|
|||||||
const QByteArray gnuTarget = startParameters().gnuTarget.toLatin1();
|
const QByteArray gnuTarget = startParameters().gnuTarget.toLatin1();
|
||||||
const QByteArray solibPath =
|
const QByteArray solibPath =
|
||||||
QFileInfo(startParameters().dumperLibrary).path().toLocal8Bit();
|
QFileInfo(startParameters().dumperLibrary).path().toLocal8Bit();
|
||||||
const QString args = startParameters().processArgs.join(_(" "));
|
const QString args = startParameters().processArgs;
|
||||||
|
|
||||||
if (!remoteArch.isEmpty())
|
if (!remoteArch.isEmpty())
|
||||||
m_engine->postCommand("set architecture " + remoteArch);
|
m_engine->postCommand("set architecture " + remoteArch);
|
||||||
|
@@ -109,8 +109,8 @@ void RemotePlainGdbAdapter::handleSetupDone(int qmlPort)
|
|||||||
startParameters().qmlServerPort = qmlPort;
|
startParameters().qmlServerPort = qmlPort;
|
||||||
if (!startParameters().workingDirectory.isEmpty())
|
if (!startParameters().workingDirectory.isEmpty())
|
||||||
m_gdbProc.setWorkingDirectory(startParameters().workingDirectory);
|
m_gdbProc.setWorkingDirectory(startParameters().workingDirectory);
|
||||||
if (!startParameters().environment.isEmpty())
|
if (startParameters().environment.size())
|
||||||
m_gdbProc.setEnvironment(startParameters().environment);
|
m_gdbProc.setEnvironment(startParameters().environment.toStringList());
|
||||||
m_gdbProc.realStart(m_engine->startParameters().debuggerCommand,
|
m_gdbProc.realStart(m_engine->startParameters().debuggerCommand,
|
||||||
QStringList() << QLatin1String("-i") << QLatin1String("mi"),
|
QStringList() << QLatin1String("-i") << QLatin1String("mi"),
|
||||||
m_engine->startParameters().executable);
|
m_engine->startParameters().executable);
|
||||||
|
@@ -44,6 +44,7 @@
|
|||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/savedaction.h>
|
#include <utils/savedaction.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
@@ -971,7 +972,7 @@ void TcfTrkGdbAdapter::startAdapter()
|
|||||||
// Retrieve parameters
|
// Retrieve parameters
|
||||||
const DebuggerStartParameters ¶meters = startParameters();
|
const DebuggerStartParameters ¶meters = startParameters();
|
||||||
m_remoteExecutable = parameters.executable;
|
m_remoteExecutable = parameters.executable;
|
||||||
m_remoteArguments = parameters.processArgs;
|
m_remoteArguments = Utils::QtcProcess::splitArgs(parameters.processArgs);
|
||||||
m_symbolFile = parameters.symbolFileName;
|
m_symbolFile = parameters.symbolFileName;
|
||||||
|
|
||||||
QPair<QString, unsigned short> tcfTrkAddress;
|
QPair<QString, unsigned short> tcfTrkAddress;
|
||||||
@@ -983,15 +984,15 @@ void TcfTrkGdbAdapter::startAdapter()
|
|||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << parameters.processArgs;
|
qDebug() << parameters.processArgs;
|
||||||
// Fixme: 1 of 3 testing hacks.
|
// Fixme: 1 of 3 testing hacks.
|
||||||
if (parameters.processArgs.size() < 5 || parameters.processArgs.at(0) != _("@tcf@")) {
|
if (m_remoteArguments.size() < 5 || m_remoteArguments.at(0) != __("@tcf@")) {
|
||||||
m_engine->handleAdapterStartFailed(_("Parameter error"), QString());
|
m_engine->handleAdapterStartFailed(_("Parameter error"), QString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_remoteExecutable = parameters.processArgs.at(1);
|
m_remoteExecutable = m_remoteArguments.at(1);
|
||||||
m_uid = parameters.processArgs.at(2).toUInt(0, 16);
|
m_uid = m_remoteArguments.at(2).toUInt(0, 16);
|
||||||
m_symbolFile = parameters.processArgs.at(3);
|
m_symbolFile = m_remoteArguments.at(3);
|
||||||
tcfTrkAddress = splitIpAddressSpec(parameters.processArgs.at(4), 1534);
|
tcfTrkAddress = splitIpAddressSpec(m_remoteArguments.at(4), 1534);
|
||||||
m_remoteArguments.clear();
|
m_remoteArguments.clear();
|
||||||
|
|
||||||
// Unixish gdbs accept only forward slashes
|
// Unixish gdbs accept only forward slashes
|
||||||
|
@@ -96,10 +96,14 @@ void TermGdbAdapter::startAdapter()
|
|||||||
// m_stubProc.stop();
|
// m_stubProc.stop();
|
||||||
// m_stubProc.blockSignals(false);
|
// m_stubProc.blockSignals(false);
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
if (!prepareWinCommand())
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
m_stubProc.setWorkingDirectory(startParameters().workingDirectory);
|
m_stubProc.setWorkingDirectory(startParameters().workingDirectory);
|
||||||
// Set environment + dumper preload.
|
// Set environment + dumper preload.
|
||||||
QStringList environment = startParameters().environment;
|
m_stubProc.setEnvironment(startParameters().environment);
|
||||||
m_stubProc.setEnvironment(environment);
|
|
||||||
// FIXME: Starting the stub implies starting the inferior. This is
|
// FIXME: Starting the stub implies starting the inferior. This is
|
||||||
// fairly unclean as far as the state machine and error reporting go.
|
// fairly unclean as far as the state machine and error reporting go.
|
||||||
if (!m_stubProc.start(startParameters().executable,
|
if (!m_stubProc.start(startParameters().executable,
|
||||||
|
@@ -46,6 +46,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/savedaction.h>
|
#include <utils/savedaction.h>
|
||||||
|
|
||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
@@ -1551,10 +1552,11 @@ void TrkGdbAdapter::startAdapter()
|
|||||||
m_symbolFile = parameters.symbolFileName;
|
m_symbolFile = parameters.symbolFileName;
|
||||||
QString remoteChannel = parameters.remoteChannel;
|
QString remoteChannel = parameters.remoteChannel;
|
||||||
// FIXME: testing hack, remove!
|
// FIXME: testing hack, remove!
|
||||||
if (parameters.processArgs.size() >= 4 && parameters.processArgs.at(0) == _("@sym@")) {
|
if (m_remoteArguments.startsWith(__("@sym@ "))) {
|
||||||
remoteChannel = parameters.processArgs.at(1);
|
QStringList pa = Utils::QtcProcess::splitArgs(m_remoteArguments);
|
||||||
m_remoteExecutable = parameters.processArgs.at(2);
|
remoteChannel = pa.at(1);
|
||||||
m_symbolFile = parameters.processArgs.at(3);
|
m_remoteExecutable = pa.at(2);
|
||||||
|
m_symbolFile = pa.at(3);
|
||||||
m_remoteArguments.clear();
|
m_remoteArguments.clear();
|
||||||
}
|
}
|
||||||
// Unixish gdbs accept only forward slashes
|
// Unixish gdbs accept only forward slashes
|
||||||
|
@@ -224,7 +224,7 @@ private:
|
|||||||
trk::Session m_session; // global-ish data (process id, target information)
|
trk::Session m_session; // global-ish data (process id, target information)
|
||||||
Symbian::Snapshot m_snapshot; // local-ish data (memory and registers)
|
Symbian::Snapshot m_snapshot; // local-ish data (memory and registers)
|
||||||
QString m_remoteExecutable;
|
QString m_remoteExecutable;
|
||||||
QStringList m_remoteArguments;
|
QString m_remoteArguments;
|
||||||
QString m_symbolFile;
|
QString m_symbolFile;
|
||||||
int m_verbose;
|
int m_verbose;
|
||||||
bool m_bufferedMemoryRead;
|
bool m_bufferedMemoryRead;
|
||||||
|
@@ -101,7 +101,7 @@ void IPCEngineHost::setupInferior()
|
|||||||
SET_NATIVE_BYTE_ORDER(s);
|
SET_NATIVE_BYTE_ORDER(s);
|
||||||
s << QFileInfo(startParameters().executable).absoluteFilePath();
|
s << QFileInfo(startParameters().executable).absoluteFilePath();
|
||||||
s << startParameters().processArgs;
|
s << startParameters().processArgs;
|
||||||
s << startParameters().environment;
|
s << startParameters().environment.toStringList();
|
||||||
}
|
}
|
||||||
rpcCall(SetupInferior, p);
|
rpcCall(SetupInferior, p);
|
||||||
}
|
}
|
||||||
|
@@ -791,13 +791,7 @@ bool QmlEngine::isShadowBuildProject() const
|
|||||||
|
|
||||||
QString QmlEngine::qmlImportPath() const
|
QString QmlEngine::qmlImportPath() const
|
||||||
{
|
{
|
||||||
const QString qmlImportPathPrefix("QML_IMPORT_PATH=");
|
return startParameters().environment.value("QML_IMPORT_PATH");
|
||||||
QStringList env = startParameters().environment;
|
|
||||||
foreach (const QString &envStr, env) {
|
|
||||||
if (envStr.startsWith(qmlImportPathPrefix))
|
|
||||||
return envStr.mid(qmlImportPathPrefix.length());
|
|
||||||
}
|
|
||||||
return QString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmlEngine::toShadowBuildFilename(const QString &filename) const
|
QString QmlEngine::toShadowBuildFilename(const QString &filename) const
|
||||||
|
@@ -42,6 +42,7 @@
|
|||||||
#include <coreplugin/variablemanager.h>
|
#include <coreplugin/variablemanager.h>
|
||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QtGui/QFormLayout>
|
#include <QtGui/QFormLayout>
|
||||||
#include <QtGui/QGroupBox>
|
#include <QtGui/QGroupBox>
|
||||||
@@ -132,26 +133,18 @@ QVariantMap GenericMakeStep::toMap() const
|
|||||||
bool GenericMakeStep::fromMap(const QVariantMap &map)
|
bool GenericMakeStep::fromMap(const QVariantMap &map)
|
||||||
{
|
{
|
||||||
m_buildTargets = map.value(QLatin1String(BUILD_TARGETS_KEY)).toStringList();
|
m_buildTargets = map.value(QLatin1String(BUILD_TARGETS_KEY)).toStringList();
|
||||||
m_makeArguments = map.value(QLatin1String(MAKE_ARGUMENTS_KEY)).toStringList();
|
m_makeArguments = map.value(QLatin1String(MAKE_ARGUMENTS_KEY)).toString();
|
||||||
m_makeCommand = map.value(QLatin1String(MAKE_COMMAND_KEY)).toString();
|
m_makeCommand = map.value(QLatin1String(MAKE_COMMAND_KEY)).toString();
|
||||||
|
|
||||||
return BuildStep::fromMap(map);
|
return BuildStep::fromMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList GenericMakeStep::replacedArguments() const
|
QString GenericMakeStep::replacedArguments() const
|
||||||
{
|
{
|
||||||
Utils::AbstractMacroExpander *mx = Core::VariableManager::instance()->macroExpander();
|
QString replacedArguments = m_makeArguments;
|
||||||
const QStringList targets = m_buildTargets;
|
Utils::QtcProcess::addArgs(&replacedArguments, m_buildTargets);
|
||||||
QStringList arguments = m_makeArguments;
|
Utils::QtcProcess::expandMacros(&replacedArguments,
|
||||||
QStringList replacedArguments;
|
Core::VariableManager::instance()->macroExpander());
|
||||||
foreach (QString arg, arguments) {
|
|
||||||
Utils::expandMacros(&arg, mx);
|
|
||||||
replacedArguments << arg;
|
|
||||||
}
|
|
||||||
foreach (QString arg, targets) {
|
|
||||||
Utils::expandMacros(&arg, mx);
|
|
||||||
replacedArguments << arg;
|
|
||||||
}
|
|
||||||
return replacedArguments;
|
return replacedArguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,11 +238,8 @@ void GenericMakeStepConfigWidget::init()
|
|||||||
{
|
{
|
||||||
updateMakeOverrrideLabel();
|
updateMakeOverrrideLabel();
|
||||||
|
|
||||||
QString makeCommand = m_makeStep->m_makeCommand;
|
m_ui->makeLineEdit->setText(m_makeStep->m_makeCommand);
|
||||||
m_ui->makeLineEdit->setText(makeCommand);
|
m_ui->makeArgumentsLineEdit->setText(m_makeStep->m_makeArguments);
|
||||||
|
|
||||||
const QStringList &makeArguments = m_makeStep->m_makeArguments;
|
|
||||||
m_ui->makeArgumentsLineEdit->setText(Utils::Environment::joinArgumentList(makeArguments));
|
|
||||||
|
|
||||||
// Disconnect to make the changes to the items
|
// Disconnect to make the changes to the items
|
||||||
disconnect(m_ui->targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
|
disconnect(m_ui->targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
|
||||||
@@ -268,8 +258,7 @@ void GenericMakeStepConfigWidget::init()
|
|||||||
void GenericMakeStepConfigWidget::updateDetails()
|
void GenericMakeStepConfigWidget::updateDetails()
|
||||||
{
|
{
|
||||||
m_summaryText = tr("<b>Make:</b> %1 %2")
|
m_summaryText = tr("<b>Make:</b> %1 %2")
|
||||||
.arg(m_makeStep->makeCommand(),
|
.arg(m_makeStep->makeCommand(), m_makeStep->replacedArguments());
|
||||||
Utils::Environment::joinArgumentList(m_makeStep->replacedArguments()));
|
|
||||||
emit updateSummary();
|
emit updateSummary();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,8 +281,7 @@ void GenericMakeStepConfigWidget::makeLineEditTextEdited()
|
|||||||
|
|
||||||
void GenericMakeStepConfigWidget::makeArgumentsLineEditTextEdited()
|
void GenericMakeStepConfigWidget::makeArgumentsLineEditTextEdited()
|
||||||
{
|
{
|
||||||
m_makeStep->m_makeArguments =
|
m_makeStep->m_makeArguments = m_ui->makeArgumentsLineEdit->text();
|
||||||
Utils::Environment::parseCombinedArgString(m_ui->makeArgumentsLineEdit->text());
|
|
||||||
updateDetails();
|
updateDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -67,7 +67,7 @@ public:
|
|||||||
virtual bool immutable() const;
|
virtual bool immutable() const;
|
||||||
bool buildsTarget(const QString &target) const;
|
bool buildsTarget(const QString &target) const;
|
||||||
void setBuildTarget(const QString &target, bool on);
|
void setBuildTarget(const QString &target, bool on);
|
||||||
QStringList replacedArguments() const;
|
QString replacedArguments() const;
|
||||||
QString makeCommand() const;
|
QString makeCommand() const;
|
||||||
|
|
||||||
QVariantMap toMap() const;
|
QVariantMap toMap() const;
|
||||||
@@ -81,7 +81,7 @@ private:
|
|||||||
void ctor();
|
void ctor();
|
||||||
|
|
||||||
QStringList m_buildTargets;
|
QStringList m_buildTargets;
|
||||||
QStringList m_makeArguments;
|
QString m_makeArguments;
|
||||||
QString m_makeCommand;
|
QString m_makeCommand;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -49,6 +49,7 @@
|
|||||||
|
|
||||||
#include <texteditor/itexteditor.h>
|
#include <texteditor/itexteditor.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <vcsbase/vcsbaseeditor.h>
|
#include <vcsbase/vcsbaseeditor.h>
|
||||||
@@ -1352,7 +1353,7 @@ bool GitClient::tryLauchingGitK(const QProcessEnvironment &env,
|
|||||||
#endif
|
#endif
|
||||||
VCSBase::VCSBaseOutputWindow *outwin = VCSBase::VCSBaseOutputWindow::instance();
|
VCSBase::VCSBaseOutputWindow *outwin = VCSBase::VCSBaseOutputWindow::instance();
|
||||||
if (!m_settings.gitkOptions.isEmpty())
|
if (!m_settings.gitkOptions.isEmpty())
|
||||||
arguments.append(m_settings.gitkOptions.split(QLatin1Char(' ')));
|
arguments.append(Utils::QtcProcess::splitArgs(m_settings.gitkOptions));
|
||||||
outwin->appendCommand(workingDirectory, binary, arguments);
|
outwin->appendCommand(workingDirectory, binary, arguments);
|
||||||
// This should always use QProcess::startDetached (as not to kill
|
// This should always use QProcess::startDetached (as not to kill
|
||||||
// the child), but that does not have an environment parameter.
|
// the child), but that does not have an environment parameter.
|
||||||
|
@@ -35,6 +35,7 @@
|
|||||||
#include "target.h"
|
#include "target.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QtCore/QEventLoop>
|
#include <QtCore/QEventLoop>
|
||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
@@ -113,12 +114,12 @@ void AbstractProcessStep::setWorkingDirectory(const QString &workingDirectory)
|
|||||||
m_workingDirectory = workingDirectory;
|
m_workingDirectory = workingDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractProcessStep::setArguments(const QStringList &arguments)
|
void AbstractProcessStep::setArguments(const QString &arguments)
|
||||||
{
|
{
|
||||||
m_arguments = arguments;
|
m_arguments = arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList AbstractProcessStep::arguments() const
|
QString AbstractProcessStep::arguments() const
|
||||||
{
|
{
|
||||||
return m_arguments;
|
return m_arguments;
|
||||||
}
|
}
|
||||||
@@ -154,9 +155,9 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi)
|
|||||||
if (!wd.exists())
|
if (!wd.exists())
|
||||||
wd.mkpath(wd.absolutePath());
|
wd.mkpath(wd.absolutePath());
|
||||||
|
|
||||||
m_process = new QProcess();
|
m_process = new Utils::QtcProcess();
|
||||||
m_process->setWorkingDirectory(wd.absolutePath());
|
m_process->setWorkingDirectory(wd.absolutePath());
|
||||||
m_process->setEnvironment(m_environment.toStringList());
|
m_process->setEnvironment(m_environment);
|
||||||
|
|
||||||
connect(m_process, SIGNAL(readyReadStandardOutput()),
|
connect(m_process, SIGNAL(readyReadStandardOutput()),
|
||||||
this, SLOT(processReadyReadStdOutput()),
|
this, SLOT(processReadyReadStdOutput()),
|
||||||
@@ -169,7 +170,8 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi)
|
|||||||
this, SLOT(slotProcessFinished(int, QProcess::ExitStatus)),
|
this, SLOT(slotProcessFinished(int, QProcess::ExitStatus)),
|
||||||
Qt::DirectConnection);
|
Qt::DirectConnection);
|
||||||
|
|
||||||
m_process->start(expandedCommand(), m_environment.expandVariables(m_arguments));
|
m_process->setCommand(expandedCommand(), m_arguments);
|
||||||
|
m_process->start();
|
||||||
if (!m_process->waitForStarted()) {
|
if (!m_process->waitForStarted()) {
|
||||||
processStartupFailed();
|
processStartupFailed();
|
||||||
delete m_process;
|
delete m_process;
|
||||||
@@ -210,8 +212,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi)
|
|||||||
void AbstractProcessStep::processStarted()
|
void AbstractProcessStep::processStarted()
|
||||||
{
|
{
|
||||||
emit addOutput(tr("Starting: \"%1\" %2\n")
|
emit addOutput(tr("Starting: \"%1\" %2\n")
|
||||||
.arg(QDir::toNativeSeparators(expandedCommand()),
|
.arg(QDir::toNativeSeparators(expandedCommand()), expandedArguments()),
|
||||||
m_environment.expandVariables(m_arguments).join(QChar(' '))),
|
|
||||||
BuildStep::MessageOutput);
|
BuildStep::MessageOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,9 +233,8 @@ void AbstractProcessStep::processFinished(int exitCode, QProcess::ExitStatus sta
|
|||||||
|
|
||||||
void AbstractProcessStep::processStartupFailed()
|
void AbstractProcessStep::processStartupFailed()
|
||||||
{
|
{
|
||||||
emit addOutput(tr("Could not start process \"%1\" %2").
|
emit addOutput(tr("Could not start process \"%1\" %2")
|
||||||
arg(QDir::toNativeSeparators(expandedCommand()),
|
.arg(QDir::toNativeSeparators(expandedCommand()), expandedArguments()),
|
||||||
m_environment.expandVariables(m_arguments).join(QChar(' '))),
|
|
||||||
BuildStep::ErrorMessageOutput);
|
BuildStep::ErrorMessageOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,3 +359,21 @@ QString AbstractProcessStep::expandedCommand() const
|
|||||||
command = m_command;
|
command = m_command;
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString AbstractProcessStep::expandedArguments() const
|
||||||
|
{
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
QString args;
|
||||||
|
#else
|
||||||
|
QStringList args;
|
||||||
|
#endif
|
||||||
|
Utils::QtcProcess::SplitError err;
|
||||||
|
args = Utils::QtcProcess::prepareArgs(m_arguments, &err, &m_environment);
|
||||||
|
if (err != Utils::QtcProcess::SplitOk)
|
||||||
|
return m_arguments; // Sorry, too complex - just fall back.
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
return args;
|
||||||
|
#else
|
||||||
|
return Utils::QtcProcess::joinArgs(args);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
@@ -34,8 +34,9 @@
|
|||||||
|
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
|
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
#include <QtCore/QProcess>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QEventLoop;
|
class QEventLoop;
|
||||||
@@ -93,8 +94,8 @@ public:
|
|||||||
|
|
||||||
/// sets the command line arguments used by the process for a \p buildConfiguration
|
/// sets the command line arguments used by the process for a \p buildConfiguration
|
||||||
/// should be called from init()
|
/// should be called from init()
|
||||||
void setArguments(const QStringList &arguments);
|
void setArguments(const QString &arguments);
|
||||||
QStringList arguments() const;
|
QString arguments() const;
|
||||||
|
|
||||||
/// enables or disables a BuildStep
|
/// enables or disables a BuildStep
|
||||||
/// Disabled BuildSteps immediately return true from their run method
|
/// Disabled BuildSteps immediately return true from their run method
|
||||||
@@ -125,6 +126,8 @@ protected:
|
|||||||
|
|
||||||
/// Get the fully expanded command name to run:
|
/// Get the fully expanded command name to run:
|
||||||
QString expandedCommand() const;
|
QString expandedCommand() const;
|
||||||
|
/// Get the fully expanded command line args. This is for display purposes only!
|
||||||
|
QString expandedArguments() const;
|
||||||
|
|
||||||
/// Called after the process is started
|
/// Called after the process is started
|
||||||
/// the default implementation adds a process started message to the output message
|
/// the default implementation adds a process started message to the output message
|
||||||
@@ -161,10 +164,10 @@ private:
|
|||||||
QFutureInterface<bool> *m_futureInterface;
|
QFutureInterface<bool> *m_futureInterface;
|
||||||
QString m_workingDirectory;
|
QString m_workingDirectory;
|
||||||
QString m_command;
|
QString m_command;
|
||||||
QStringList m_arguments;
|
QString m_arguments;
|
||||||
bool m_enabled;
|
bool m_enabled;
|
||||||
bool m_ignoreReturnValue;
|
bool m_ignoreReturnValue;
|
||||||
QProcess *m_process;
|
Utils::QtcProcess *m_process;
|
||||||
QEventLoop *m_eventLoop;
|
QEventLoop *m_eventLoop;
|
||||||
Utils::Environment m_environment;
|
Utils::Environment m_environment;
|
||||||
ProjectExplorer::IOutputParser *m_outputParserChain;
|
ProjectExplorer::IOutputParser *m_outputParserChain;
|
||||||
|
@@ -32,12 +32,10 @@
|
|||||||
|
|
||||||
#include "projectexplorer_export.h"
|
#include "projectexplorer_export.h"
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
|
||||||
#include <QtCore/QStringList>
|
|
||||||
#include <QtCore/QProcess>
|
#include <QtCore/QProcess>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
class ConsoleProcess;
|
class Environment;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
@@ -57,10 +55,10 @@ public:
|
|||||||
~ApplicationLauncher();
|
~ApplicationLauncher();
|
||||||
|
|
||||||
void setWorkingDirectory(const QString &dir);
|
void setWorkingDirectory(const QString &dir);
|
||||||
void setEnvironment(const QStringList &env);
|
void setEnvironment(const Utils::Environment &env);
|
||||||
|
|
||||||
void start(Mode mode, const QString &program,
|
void start(Mode mode, const QString &program,
|
||||||
const QStringList &args = QStringList());
|
const QString &args = QString());
|
||||||
void stop();
|
void stop();
|
||||||
bool isRunning() const;
|
bool isRunning() const;
|
||||||
qint64 applicationPID() const;
|
qint64 applicationPID() const;
|
||||||
|
@@ -69,13 +69,13 @@ void ApplicationLauncher::setWorkingDirectory(const QString &dir)
|
|||||||
d->m_consoleProcess.setWorkingDirectory(dir);
|
d->m_consoleProcess.setWorkingDirectory(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplicationLauncher::setEnvironment(const QStringList &env)
|
void ApplicationLauncher::setEnvironment(const Utils::Environment &env)
|
||||||
{
|
{
|
||||||
d->m_winGuiProcess.setEnvironment(env);
|
d->m_winGuiProcess.setEnvironment(env);
|
||||||
d->m_consoleProcess.setEnvironment(env);
|
d->m_consoleProcess.setEnvironment(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplicationLauncher::start(Mode mode, const QString &program, const QStringList &args)
|
void ApplicationLauncher::start(Mode mode, const QString &program, const QString &args)
|
||||||
{
|
{
|
||||||
d->m_currentMode = mode;
|
d->m_currentMode = mode;
|
||||||
if (mode == Gui) {
|
if (mode == Gui) {
|
||||||
|
@@ -32,6 +32,8 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
#include <QtCore/QTextCodec>
|
#include <QtCore/QTextCodec>
|
||||||
|
|
||||||
@@ -40,7 +42,7 @@ namespace ProjectExplorer {
|
|||||||
struct ApplicationLauncherPrivate {
|
struct ApplicationLauncherPrivate {
|
||||||
ApplicationLauncherPrivate();
|
ApplicationLauncherPrivate();
|
||||||
|
|
||||||
QProcess m_guiProcess;
|
Utils::QtcProcess m_guiProcess;
|
||||||
Utils::ConsoleProcess m_consoleProcess;
|
Utils::ConsoleProcess m_consoleProcess;
|
||||||
ApplicationLauncher::Mode m_currentMode;
|
ApplicationLauncher::Mode m_currentMode;
|
||||||
|
|
||||||
@@ -87,17 +89,18 @@ void ApplicationLauncher::setWorkingDirectory(const QString &dir)
|
|||||||
d->m_consoleProcess.setWorkingDirectory(dir);
|
d->m_consoleProcess.setWorkingDirectory(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplicationLauncher::setEnvironment(const QStringList &env)
|
void ApplicationLauncher::setEnvironment(const Utils::Environment &env)
|
||||||
{
|
{
|
||||||
d->m_guiProcess.setEnvironment(env);
|
d->m_guiProcess.setEnvironment(env);
|
||||||
d->m_consoleProcess.setEnvironment(env);
|
d->m_consoleProcess.setEnvironment(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplicationLauncher::start(Mode mode, const QString &program, const QStringList &args)
|
void ApplicationLauncher::start(Mode mode, const QString &program, const QString &args)
|
||||||
{
|
{
|
||||||
d->m_currentMode = mode;
|
d->m_currentMode = mode;
|
||||||
if (mode == Gui) {
|
if (mode == Gui) {
|
||||||
d->m_guiProcess.start(program, args);
|
d->m_guiProcess.setCommand(program, args);
|
||||||
|
d->m_guiProcess.start();
|
||||||
} else {
|
} else {
|
||||||
d->m_consoleProcess.start(program, args);
|
d->m_consoleProcess.start(program, args);
|
||||||
}
|
}
|
||||||
|
@@ -48,4 +48,3 @@ LocalApplicationRunConfiguration::~LocalApplicationRunConfiguration()
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
|
@@ -54,7 +54,7 @@ public:
|
|||||||
virtual QString executable() const = 0;
|
virtual QString executable() const = 0;
|
||||||
virtual RunMode runMode() const = 0;
|
virtual RunMode runMode() const = 0;
|
||||||
virtual QString workingDirectory() const = 0;
|
virtual QString workingDirectory() const = 0;
|
||||||
virtual QStringList commandLineArguments() const = 0;
|
virtual QString commandLineArguments() const = 0;
|
||||||
virtual Utils::Environment environment() const = 0;
|
virtual Utils::Environment environment() const = 0;
|
||||||
virtual QString dumperLibrary() const = 0;
|
virtual QString dumperLibrary() const = 0;
|
||||||
virtual QStringList dumperLibraryLocations() const = 0;
|
virtual QStringList dumperLibraryLocations() const = 0;
|
||||||
|
@@ -231,7 +231,7 @@ void CustomExecutableConfigurationWidget::executableEdited()
|
|||||||
void CustomExecutableConfigurationWidget::argumentsEdited(const QString &arguments)
|
void CustomExecutableConfigurationWidget::argumentsEdited(const QString &arguments)
|
||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_runConfiguration->setBaseCommandLineArguments(arguments);
|
m_runConfiguration->setCommandLineArguments(arguments);
|
||||||
m_ignoreChange = false;
|
m_ignoreChange = false;
|
||||||
}
|
}
|
||||||
void CustomExecutableConfigurationWidget::workingDirectoryEdited()
|
void CustomExecutableConfigurationWidget::workingDirectoryEdited()
|
||||||
@@ -256,7 +256,7 @@ void CustomExecutableConfigurationWidget::changed()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
m_executableChooser->setPath(m_runConfiguration->rawExecutable());
|
m_executableChooser->setPath(m_runConfiguration->rawExecutable());
|
||||||
m_commandLineArgumentsLineEdit->setText(Utils::Environment::joinArgumentList(m_runConfiguration->baseCommandLineArguments()));
|
m_commandLineArgumentsLineEdit->setText(m_runConfiguration->commandLineArguments());
|
||||||
m_workingDirectory->setPath(m_runConfiguration->baseWorkingDirectory());
|
m_workingDirectory->setPath(m_runConfiguration->baseWorkingDirectory());
|
||||||
m_useTerminalCheck->setChecked(m_runConfiguration->runMode() == LocalApplicationRunConfiguration::Console);
|
m_useTerminalCheck->setChecked(m_runConfiguration->runMode() == LocalApplicationRunConfiguration::Console);
|
||||||
}
|
}
|
||||||
|
@@ -141,7 +141,7 @@ QString CustomExecutableRunConfiguration::executable() const
|
|||||||
|
|
||||||
QString oldExecutable = m_executable;
|
QString oldExecutable = m_executable;
|
||||||
QString oldWorkingDirectory = m_workingDirectory;
|
QString oldWorkingDirectory = m_workingDirectory;
|
||||||
QStringList oldCmdArguments = m_cmdArguments;
|
QString oldCmdArguments = m_cmdArguments;
|
||||||
|
|
||||||
if (dialog.exec()) {
|
if (dialog.exec()) {
|
||||||
return executable();
|
return executable();
|
||||||
@@ -183,12 +183,7 @@ QString CustomExecutableRunConfiguration::baseWorkingDirectory() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QStringList CustomExecutableRunConfiguration::commandLineArguments() const
|
QString CustomExecutableRunConfiguration::commandLineArguments() const
|
||||||
{
|
|
||||||
return environment().expandVariables(baseCommandLineArguments());
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList CustomExecutableRunConfiguration::baseCommandLineArguments() const
|
|
||||||
{
|
{
|
||||||
return m_cmdArguments;
|
return m_cmdArguments;
|
||||||
}
|
}
|
||||||
@@ -275,7 +270,7 @@ QVariantMap CustomExecutableRunConfiguration::toMap() const
|
|||||||
bool CustomExecutableRunConfiguration::fromMap(const QVariantMap &map)
|
bool CustomExecutableRunConfiguration::fromMap(const QVariantMap &map)
|
||||||
{
|
{
|
||||||
m_executable = map.value(QLatin1String(EXECUTABLE_KEY)).toString();
|
m_executable = map.value(QLatin1String(EXECUTABLE_KEY)).toString();
|
||||||
m_cmdArguments = map.value(QLatin1String(ARGUMENTS_KEY)).toStringList();
|
m_cmdArguments = map.value(QLatin1String(ARGUMENTS_KEY)).toString();
|
||||||
m_workingDirectory = map.value(QLatin1String(WORKING_DIRECTORY_KEY)).toString();
|
m_workingDirectory = map.value(QLatin1String(WORKING_DIRECTORY_KEY)).toString();
|
||||||
m_runMode = map.value(QLatin1String(USE_TERMINAL_KEY)).toBool() ? Console : Gui;
|
m_runMode = map.value(QLatin1String(USE_TERMINAL_KEY)).toBool() ? Console : Gui;
|
||||||
m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
|
m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
|
||||||
@@ -294,9 +289,9 @@ void CustomExecutableRunConfiguration::setExecutable(const QString &executable)
|
|||||||
emit changed();
|
emit changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomExecutableRunConfiguration::setBaseCommandLineArguments(const QString &commandLineArguments)
|
void CustomExecutableRunConfiguration::setCommandLineArguments(const QString &commandLineArguments)
|
||||||
{
|
{
|
||||||
m_cmdArguments = Utils::Environment::parseCombinedArgString(commandLineArguments);
|
m_cmdArguments = commandLineArguments;
|
||||||
emit changed();
|
emit changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -69,7 +69,7 @@ public:
|
|||||||
|
|
||||||
LocalApplicationRunConfiguration::RunMode runMode() const;
|
LocalApplicationRunConfiguration::RunMode runMode() const;
|
||||||
QString workingDirectory() const;
|
QString workingDirectory() const;
|
||||||
QStringList commandLineArguments() const;
|
QString commandLineArguments() const;
|
||||||
Utils::Environment environment() const;
|
Utils::Environment environment() const;
|
||||||
|
|
||||||
QWidget *createConfigurationWidget();
|
QWidget *createConfigurationWidget();
|
||||||
@@ -108,8 +108,7 @@ private:
|
|||||||
QList<Utils::EnvironmentItem> userEnvironmentChanges() const;
|
QList<Utils::EnvironmentItem> userEnvironmentChanges() const;
|
||||||
|
|
||||||
void setExecutable(const QString &executable);
|
void setExecutable(const QString &executable);
|
||||||
void setBaseCommandLineArguments(const QString &commandLineArguments);
|
void setCommandLineArguments(const QString &commandLineArguments);
|
||||||
QStringList baseCommandLineArguments() const;
|
|
||||||
QString baseWorkingDirectory() const;
|
QString baseWorkingDirectory() const;
|
||||||
void setBaseWorkingDirectory(const QString &workingDirectory);
|
void setBaseWorkingDirectory(const QString &workingDirectory);
|
||||||
void setUserName(const QString &name);
|
void setUserName(const QString &name);
|
||||||
@@ -117,7 +116,7 @@ private:
|
|||||||
|
|
||||||
QString m_executable;
|
QString m_executable;
|
||||||
QString m_workingDirectory;
|
QString m_workingDirectory;
|
||||||
QStringList m_cmdArguments;
|
QString m_cmdArguments;
|
||||||
RunMode m_runMode;
|
RunMode m_runMode;
|
||||||
bool m_userSetName;
|
bool m_userSetName;
|
||||||
QString m_userName;
|
QString m_userName;
|
||||||
|
@@ -40,6 +40,7 @@
|
|||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/unixutils.h>
|
#include <utils/unixutils.h>
|
||||||
#include <utils/consoleprocess.h>
|
#include <utils/consoleprocess.h>
|
||||||
|
|
||||||
@@ -438,8 +439,8 @@ void FolderNavigationWidget::openTerminal(const QString &path)
|
|||||||
const QString terminalEmulator = QString::fromLocal8Bit(qgetenv("COMSPEC"));
|
const QString terminalEmulator = QString::fromLocal8Bit(qgetenv("COMSPEC"));
|
||||||
const QStringList args; // none
|
const QStringList args; // none
|
||||||
#else
|
#else
|
||||||
QStringList args = Utils::ConsoleProcess::terminalEmulator(
|
QStringList args = Utils::QtcProcess::splitArgs(
|
||||||
Core::ICore::instance()->settings()).split(QLatin1Char(' '));
|
Utils::ConsoleProcess::terminalEmulator(Core::ICore::instance()->settings()));
|
||||||
const QString terminalEmulator = args.takeFirst();
|
const QString terminalEmulator = args.takeFirst();
|
||||||
const QString shell = QString::fromLocal8Bit(qgetenv("SHELL"));
|
const QString shell = QString::fromLocal8Bit(qgetenv("SHELL"));
|
||||||
args.append(shell);
|
args.append(shell);
|
||||||
|
@@ -78,7 +78,7 @@ LocalApplicationRunControl::LocalApplicationRunControl(LocalApplicationRunConfig
|
|||||||
{
|
{
|
||||||
Utils::Environment env = rc->environment();
|
Utils::Environment env = rc->environment();
|
||||||
QString dir = rc->workingDirectory();
|
QString dir = rc->workingDirectory();
|
||||||
m_applicationLauncher.setEnvironment(env.toStringList());
|
m_applicationLauncher.setEnvironment(env);
|
||||||
m_applicationLauncher.setWorkingDirectory(dir);
|
m_applicationLauncher.setWorkingDirectory(dir);
|
||||||
|
|
||||||
m_executable = rc->executable();
|
m_executable = rc->executable();
|
||||||
|
@@ -66,7 +66,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
ProjectExplorer::ApplicationLauncher m_applicationLauncher;
|
ProjectExplorer::ApplicationLauncher m_applicationLauncher;
|
||||||
QString m_executable;
|
QString m_executable;
|
||||||
QStringList m_commandLineArguments;
|
QString m_commandLineArguments;
|
||||||
ProjectExplorer::ApplicationLauncher::Mode m_runMode;
|
ProjectExplorer::ApplicationLauncher::Mode m_runMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
#include "buildconfiguration.h"
|
#include "buildconfiguration.h"
|
||||||
|
|
||||||
#include <coreplugin/ifile.h>
|
#include <coreplugin/ifile.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
@@ -124,7 +125,7 @@ QString ProcessStep::command() const
|
|||||||
return m_command;
|
return m_command;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList ProcessStep::arguments() const
|
QString ProcessStep::arguments() const
|
||||||
{
|
{
|
||||||
return m_arguments;
|
return m_arguments;
|
||||||
}
|
}
|
||||||
@@ -144,7 +145,7 @@ void ProcessStep::setCommand(const QString &command)
|
|||||||
m_command = command;
|
m_command = command;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessStep::setArguments(const QStringList &arguments)
|
void ProcessStep::setArguments(const QString &arguments)
|
||||||
{
|
{
|
||||||
m_arguments = arguments;
|
m_arguments = arguments;
|
||||||
}
|
}
|
||||||
@@ -176,7 +177,7 @@ QVariantMap ProcessStep::toMap() const
|
|||||||
bool ProcessStep::fromMap(const QVariantMap &map)
|
bool ProcessStep::fromMap(const QVariantMap &map)
|
||||||
{
|
{
|
||||||
setCommand(map.value(QLatin1String(PROCESS_COMMAND_KEY)).toString());
|
setCommand(map.value(QLatin1String(PROCESS_COMMAND_KEY)).toString());
|
||||||
setArguments(map.value(QLatin1String(PROCESS_ARGUMENTS_KEY)).toStringList());
|
setArguments(map.value(QLatin1String(PROCESS_ARGUMENTS_KEY)).toString());
|
||||||
setWorkingDirectory(map.value(QLatin1String(PROCESS_WORKINGDIRECTORY_KEY)).toString());
|
setWorkingDirectory(map.value(QLatin1String(PROCESS_WORKINGDIRECTORY_KEY)).toString());
|
||||||
setEnabled(map.value(QLatin1String(PROCESS_ENABLED_KEY), false).toBool());
|
setEnabled(map.value(QLatin1String(PROCESS_ENABLED_KEY), false).toBool());
|
||||||
return AbstractProcessStep::fromMap(map);
|
return AbstractProcessStep::fromMap(map);
|
||||||
@@ -277,7 +278,7 @@ void ProcessStepConfigWidget::updateDetails()
|
|||||||
m_summaryText = tr("<b>%1</b> %2 %3 %4")
|
m_summaryText = tr("<b>%1</b> %2 %3 %4")
|
||||||
.arg(displayName,
|
.arg(displayName,
|
||||||
m_step->command(),
|
m_step->command(),
|
||||||
m_step->arguments().join(QString(QLatin1Char(' '))),
|
m_step->arguments(),
|
||||||
m_step->enabled() ? QString() : tr("(disabled)"));
|
m_step->enabled() ? QString() : tr("(disabled)"));
|
||||||
emit updateSummary();
|
emit updateSummary();
|
||||||
}
|
}
|
||||||
@@ -295,7 +296,7 @@ void ProcessStepConfigWidget::init()
|
|||||||
m_ui.workingDirectory->setEnvironment(m_step->buildConfiguration()->environment());
|
m_ui.workingDirectory->setEnvironment(m_step->buildConfiguration()->environment());
|
||||||
m_ui.workingDirectory->setPath(m_step->workingDirectory());
|
m_ui.workingDirectory->setPath(m_step->workingDirectory());
|
||||||
|
|
||||||
m_ui.commandArgumentsLineEdit->setText(m_step->arguments().join(QString(QLatin1Char(' '))));
|
m_ui.commandArgumentsLineEdit->setText(m_step->arguments());
|
||||||
m_ui.enabledCheckBox->setChecked(m_step->enabled());
|
m_ui.enabledCheckBox->setChecked(m_step->enabled());
|
||||||
|
|
||||||
updateDetails();
|
updateDetails();
|
||||||
@@ -319,8 +320,7 @@ void ProcessStepConfigWidget::workingDirectoryLineEditTextEdited()
|
|||||||
|
|
||||||
void ProcessStepConfigWidget::commandArgumentsLineEditTextEdited()
|
void ProcessStepConfigWidget::commandArgumentsLineEditTextEdited()
|
||||||
{
|
{
|
||||||
m_step->setArguments(m_ui.commandArgumentsLineEdit->text().split(QLatin1Char(' '),
|
m_step->setArguments(m_ui.commandArgumentsLineEdit->text());
|
||||||
QString::SkipEmptyParts));
|
|
||||||
updateDetails();
|
updateDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -73,12 +73,12 @@ public:
|
|||||||
virtual bool immutable() const;
|
virtual bool immutable() const;
|
||||||
|
|
||||||
QString command() const;
|
QString command() const;
|
||||||
QStringList arguments() const;
|
QString arguments() const;
|
||||||
bool enabled() const;
|
bool enabled() const;
|
||||||
QString workingDirectory() const;
|
QString workingDirectory() const;
|
||||||
|
|
||||||
void setCommand(const QString &command);
|
void setCommand(const QString &command);
|
||||||
void setArguments(const QStringList &arguments);
|
void setArguments(const QString &arguments);
|
||||||
void setEnabled(bool enabled);
|
void setEnabled(bool enabled);
|
||||||
void setWorkingDirectory(const QString &workingDirectory);
|
void setWorkingDirectory(const QString &workingDirectory);
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ private:
|
|||||||
void ctor();
|
void ctor();
|
||||||
|
|
||||||
QString m_command;
|
QString m_command;
|
||||||
QStringList m_arguments;
|
QString m_arguments;
|
||||||
QString m_workingDirectory;
|
QString m_workingDirectory;
|
||||||
Utils::Environment m_env;
|
Utils::Environment m_env;
|
||||||
bool m_enabled;
|
bool m_enabled;
|
||||||
|
@@ -35,8 +35,8 @@
|
|||||||
#include "msvcparser.h"
|
#include "msvcparser.h"
|
||||||
#include "linuxiccparser.h"
|
#include "linuxiccparser.h"
|
||||||
|
|
||||||
|
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
@@ -768,16 +768,16 @@ MSVCToolChain::StringStringPairList MSVCToolChain::readEnvironmentSettingI(const
|
|||||||
if (!tf.open())
|
if (!tf.open())
|
||||||
return StringStringPairList();
|
return StringStringPairList();
|
||||||
const QString filename = tf.fileName();
|
const QString filename = tf.fileName();
|
||||||
QByteArray call = "call \"";
|
QByteArray call = "call ";
|
||||||
call += varsBat.toLocal8Bit();
|
call += Utils::QtcProcess::quoteArg(varsBat).toLocal8Bit();
|
||||||
call += '"';
|
|
||||||
if (!args.isEmpty()) {
|
if (!args.isEmpty()) {
|
||||||
call += ' ';
|
call += ' ';
|
||||||
call += args.join(QString(QLatin1Char(' '))).toLocal8Bit();
|
call += Utils::QtcProcess::joinArgs(args).toLocal8Bit();
|
||||||
}
|
}
|
||||||
call += "\r\n";
|
call += "\r\n";
|
||||||
tf.write(call);
|
tf.write(call);
|
||||||
const QByteArray redirect = "set > \"" + QDir::toNativeSeparators(tempOutputFileName).toLocal8Bit() + "\"\r\n";
|
const QByteArray redirect = "set > " + Utils::QtcProcess::quoteArg(
|
||||||
|
QDir::toNativeSeparators(tempOutputFileName)).toLocal8Bit() + "\r\n";
|
||||||
tf.write(redirect);
|
tf.write(redirect);
|
||||||
tf.flush();
|
tf.flush();
|
||||||
tf.waitForBytesWritten(30000);
|
tf.waitForBytesWritten(30000);
|
||||||
|
@@ -30,6 +30,8 @@
|
|||||||
#include "winguiprocess.h"
|
#include "winguiprocess.h"
|
||||||
#include "consoleprocess.h"
|
#include "consoleprocess.h"
|
||||||
|
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
|
|
||||||
using namespace ProjectExplorer::Internal;
|
using namespace ProjectExplorer::Internal;
|
||||||
@@ -46,7 +48,7 @@ WinGuiProcess::~WinGuiProcess()
|
|||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WinGuiProcess::start(const QString &program, const QStringList &args)
|
bool WinGuiProcess::start(const QString &program, const QString &args)
|
||||||
{
|
{
|
||||||
m_program = program;
|
m_program = program;
|
||||||
m_args = args;
|
m_args = args;
|
||||||
@@ -112,11 +114,14 @@ void WinGuiProcess::run()
|
|||||||
|
|
||||||
const bool dbgInterface = setupDebugInterface(bufferReadyEvent, dataReadyEvent, sharedFile, sharedMem);
|
const bool dbgInterface = setupDebugInterface(bufferReadyEvent, dataReadyEvent, sharedFile, sharedMem);
|
||||||
|
|
||||||
const QString cmdLine = createWinCommandline(m_program, m_args);
|
QString pcmd, pargs;
|
||||||
|
QtcProcess::prepareCommand(m_program, m_args, &pcmd, &pargs, &m_environment, &m_workingDir);
|
||||||
|
const QString cmdLine = createWinCommandline(pcmd, pargs);
|
||||||
|
const QStringList env = m_environment.toStringList();
|
||||||
started = CreateProcessW(0, (WCHAR*)cmdLine.utf16(),
|
started = CreateProcessW(0, (WCHAR*)cmdLine.utf16(),
|
||||||
0, 0, TRUE, CREATE_UNICODE_ENVIRONMENT,
|
0, 0, TRUE, CREATE_UNICODE_ENVIRONMENT,
|
||||||
environment().isEmpty() ? 0
|
env.isEmpty() ? 0
|
||||||
: createWinEnvironment(fixWinEnvironment(environment())).data(),
|
: createWinEnvironment(fixWinEnvironment(env)).data(),
|
||||||
workingDirectory().isEmpty() ? 0
|
workingDirectory().isEmpty() ? 0
|
||||||
: (WCHAR*)QDir::convertSeparators(workingDirectory()).utf16(),
|
: (WCHAR*)QDir::convertSeparators(workingDirectory()).utf16(),
|
||||||
&si, m_pid);
|
&si, m_pid);
|
||||||
|
@@ -53,7 +53,7 @@ public:
|
|||||||
explicit WinGuiProcess(QObject *parent = 0);
|
explicit WinGuiProcess(QObject *parent = 0);
|
||||||
virtual ~WinGuiProcess();
|
virtual ~WinGuiProcess();
|
||||||
|
|
||||||
bool start(const QString &program, const QStringList &args);
|
bool start(const QString &program, const QString &args);
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
bool isRunning() const;
|
bool isRunning() const;
|
||||||
@@ -71,7 +71,7 @@ private:
|
|||||||
|
|
||||||
PROCESS_INFORMATION *m_pid;
|
PROCESS_INFORMATION *m_pid;
|
||||||
QString m_program;
|
QString m_program;
|
||||||
QStringList m_args;
|
QString m_args;
|
||||||
unsigned long m_exitCode;
|
unsigned long m_exitCode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -30,6 +30,7 @@
|
|||||||
#include "qmljspreviewrunner.h"
|
#include "qmljspreviewrunner.h"
|
||||||
|
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
@@ -50,7 +51,7 @@ QmlJSPreviewRunner::QmlJSPreviewRunner(QObject *parent) :
|
|||||||
m_qmlViewerDefaultPath = Utils::SynchronousProcess::locateBinary(searchPath, QLatin1String("qmlviewer"));
|
m_qmlViewerDefaultPath = Utils::SynchronousProcess::locateBinary(searchPath, QLatin1String("qmlviewer"));
|
||||||
|
|
||||||
Utils::Environment environment = Utils::Environment::systemEnvironment();
|
Utils::Environment environment = Utils::Environment::systemEnvironment();
|
||||||
m_applicationLauncher.setEnvironment(environment.toStringList());
|
m_applicationLauncher.setEnvironment(environment);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlJSPreviewRunner::isReady() const
|
bool QmlJSPreviewRunner::isReady() const
|
||||||
@@ -63,7 +64,7 @@ void QmlJSPreviewRunner::run(const QString &filename)
|
|||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if (!filename.isEmpty()) {
|
if (!filename.isEmpty()) {
|
||||||
m_applicationLauncher.start(ProjectExplorer::ApplicationLauncher::Gui, m_qmlViewerDefaultPath,
|
m_applicationLauncher.start(ProjectExplorer::ApplicationLauncher::Gui, m_qmlViewerDefaultPath,
|
||||||
QStringList() << filename);
|
Utils::QtcProcess::quoteArg(filename));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
errorMessage = "No file specified.";
|
errorMessage = "No file specified.";
|
||||||
|
@@ -43,6 +43,7 @@
|
|||||||
#include <utils/debuggerlanguagechooser.h>
|
#include <utils/debuggerlanguagechooser.h>
|
||||||
#include <utils/detailswidget.h>
|
#include <utils/detailswidget.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <qt4projectmanager/qtversionmanager.h>
|
#include <qt4projectmanager/qtversionmanager.h>
|
||||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||||
#include <qt4projectmanager/qmlobservertool.h>
|
#include <qt4projectmanager/qmlobservertool.h>
|
||||||
@@ -135,23 +136,20 @@ QString QmlProjectRunConfiguration::observerPath() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QmlProjectRunConfiguration::viewerArguments() const
|
QString QmlProjectRunConfiguration::viewerArguments() const
|
||||||
{
|
{
|
||||||
QStringList args;
|
|
||||||
|
|
||||||
// arguments in .user file
|
// arguments in .user file
|
||||||
if (!m_qmlViewerArgs.isEmpty())
|
QString args = m_qmlViewerArgs;
|
||||||
args.append(m_qmlViewerArgs.split(QLatin1Char(' ')));
|
|
||||||
|
|
||||||
// arguments from .qmlproject file
|
// arguments from .qmlproject file
|
||||||
foreach (const QString &importPath, qmlTarget()->qmlProject()->importPaths()) {
|
foreach (const QString &importPath, qmlTarget()->qmlProject()->importPaths()) {
|
||||||
args.append(QLatin1String("-I"));
|
Utils::QtcProcess::addArg(&args, "-I");
|
||||||
args.append(importPath);
|
Utils::QtcProcess::addArg(&args, importPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString s = mainScript();
|
const QString &s = mainScript();
|
||||||
if (! s.isEmpty())
|
if (!s.isEmpty())
|
||||||
args.append(s);
|
Utils::QtcProcess::addArg(&args, s);
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -75,7 +75,7 @@ public:
|
|||||||
|
|
||||||
QString viewerPath() const;
|
QString viewerPath() const;
|
||||||
QString observerPath() const;
|
QString observerPath() const;
|
||||||
QStringList viewerArguments() const;
|
QString viewerArguments() const;
|
||||||
QString workingDirectory() const;
|
QString workingDirectory() const;
|
||||||
int qtVersionId() const;
|
int qtVersionId() const;
|
||||||
Qt4ProjectManager::QtVersion *qtVersion() const;
|
Qt4ProjectManager::QtVersion *qtVersion() const;
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
#include <qt4projectmanager/qtversionmanager.h>
|
#include <qt4projectmanager/qtversionmanager.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <debugger/debuggerrunner.h>
|
#include <debugger/debuggerrunner.h>
|
||||||
#include <debugger/debuggerplugin.h>
|
#include <debugger/debuggerplugin.h>
|
||||||
@@ -64,7 +65,9 @@ QmlRunControl::QmlRunControl(QmlProjectRunConfiguration *runConfiguration, QStri
|
|||||||
: RunControl(runConfiguration, mode)
|
: RunControl(runConfiguration, mode)
|
||||||
{
|
{
|
||||||
if (Qt4ProjectManager::QtVersion *qtVersion = runConfiguration->qtVersion())
|
if (Qt4ProjectManager::QtVersion *qtVersion = runConfiguration->qtVersion())
|
||||||
m_applicationLauncher.setEnvironment(qtVersion->qmlToolsEnvironment().toStringList());
|
m_applicationLauncher.setEnvironment(qtVersion->qmlToolsEnvironment());
|
||||||
|
else
|
||||||
|
m_applicationLauncher.setEnvironment(Utils::Environment::systemEnvironment());
|
||||||
m_applicationLauncher.setWorkingDirectory(runConfiguration->workingDirectory());
|
m_applicationLauncher.setWorkingDirectory(runConfiguration->workingDirectory());
|
||||||
|
|
||||||
if (mode == ProjectExplorer::Constants::RUNMODE) {
|
if (mode == ProjectExplorer::Constants::RUNMODE) {
|
||||||
@@ -96,7 +99,7 @@ void QmlRunControl::start()
|
|||||||
|
|
||||||
emit started();
|
emit started();
|
||||||
emit appendMessage(this, tr("Starting %1 %2").arg(QDir::toNativeSeparators(m_executable),
|
emit appendMessage(this, tr("Starting %1 %2").arg(QDir::toNativeSeparators(m_executable),
|
||||||
m_commandLineArguments.join(QLatin1String(" "))), false);
|
m_commandLineArguments), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
RunControl::StopResult QmlRunControl::stop()
|
RunControl::StopResult QmlRunControl::stop()
|
||||||
@@ -200,10 +203,11 @@ ProjectExplorer::RunControl *QmlRunControlFactory::createDebugRunControl(QmlProj
|
|||||||
params.qmlServerAddress = "127.0.0.1";
|
params.qmlServerAddress = "127.0.0.1";
|
||||||
params.qmlServerPort = runConfig->qmlDebugServerPort();
|
params.qmlServerPort = runConfig->qmlDebugServerPort();
|
||||||
params.processArgs = runConfig->viewerArguments();
|
params.processArgs = runConfig->viewerArguments();
|
||||||
params.processArgs.append(QLatin1String("-qmljsdebugger=port:") + QString::number(runConfig->qmlDebugServerPort()));
|
Utils::QtcProcess::addArg(¶ms.processArgs,
|
||||||
|
QLatin1String("-qmljsdebugger=port:") + QString::number(runConfig->qmlDebugServerPort()));
|
||||||
params.workingDirectory = runConfig->workingDirectory();
|
params.workingDirectory = runConfig->workingDirectory();
|
||||||
if (Qt4ProjectManager::QtVersion *qtVersion = runConfig->qtVersion())
|
if (Qt4ProjectManager::QtVersion *qtVersion = runConfig->qtVersion())
|
||||||
params.environment = qtVersion->qmlToolsEnvironment().toStringList();
|
params.environment = qtVersion->qmlToolsEnvironment();
|
||||||
params.displayName = runConfig->displayName();
|
params.displayName = runConfig->displayName();
|
||||||
|
|
||||||
if (params.executable.isEmpty()) {
|
if (params.executable.isEmpty()) {
|
||||||
|
@@ -61,7 +61,7 @@ private:
|
|||||||
ProjectExplorer::ApplicationLauncher m_applicationLauncher;
|
ProjectExplorer::ApplicationLauncher m_applicationLauncher;
|
||||||
|
|
||||||
QString m_executable;
|
QString m_executable;
|
||||||
QStringList m_commandLineArguments;
|
QString m_commandLineArguments;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QmlRunControlFactory : public ProjectExplorer::IRunControlFactory {
|
class QmlRunControlFactory : public ProjectExplorer::IRunControlFactory {
|
||||||
|
@@ -43,6 +43,7 @@
|
|||||||
#include <projectexplorer/gnumakeparser.h>
|
#include <projectexplorer/gnumakeparser.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
@@ -113,7 +114,7 @@ QVariantMap MakeStep::toMap() const
|
|||||||
bool MakeStep::fromMap(const QVariantMap &map)
|
bool MakeStep::fromMap(const QVariantMap &map)
|
||||||
{
|
{
|
||||||
m_makeCmd = map.value(QLatin1String(MAKE_COMMAND_KEY)).toString();
|
m_makeCmd = map.value(QLatin1String(MAKE_COMMAND_KEY)).toString();
|
||||||
m_userArgs = map.value(QLatin1String(MAKE_ARGUMENTS_KEY)).toStringList();
|
m_userArgs = map.value(QLatin1String(MAKE_ARGUMENTS_KEY)).toString();
|
||||||
m_clean = map.value(QLatin1String(CLEAN_KEY)).toBool();
|
m_clean = map.value(QLatin1String(CLEAN_KEY)).toBool();
|
||||||
|
|
||||||
return ProjectExplorer::AbstractProcessStep::fromMap(map);
|
return ProjectExplorer::AbstractProcessStep::fromMap(map);
|
||||||
@@ -150,22 +151,26 @@ bool MakeStep::init()
|
|||||||
// we should stop the clean queue
|
// we should stop the clean queue
|
||||||
// That is mostly so that rebuild works on a already clean project
|
// That is mostly so that rebuild works on a already clean project
|
||||||
setIgnoreReturnValue(m_clean);
|
setIgnoreReturnValue(m_clean);
|
||||||
QStringList args;
|
|
||||||
|
QString args;
|
||||||
|
|
||||||
ProjectExplorer::ToolChain *toolchain = bc->toolChain();
|
ProjectExplorer::ToolChain *toolchain = bc->toolChain();
|
||||||
|
|
||||||
if (bc->subNodeBuild()){
|
if (bc->subNodeBuild()){
|
||||||
if(!bc->subNodeBuild()->makefile().isEmpty()) {
|
if(!bc->subNodeBuild()->makefile().isEmpty()) {
|
||||||
args << "-f" << bc->subNodeBuild()->makefile();
|
Utils::QtcProcess::addArg(&args, QLatin1String("-f"));
|
||||||
|
Utils::QtcProcess::addArg(&args, bc->subNodeBuild()->makefile());
|
||||||
}
|
}
|
||||||
} else if (!bc->makefile().isEmpty()) {
|
} else if (!bc->makefile().isEmpty()) {
|
||||||
args << "-f" << bc->makefile();
|
Utils::QtcProcess::addArg(&args, QLatin1String("-f"));
|
||||||
|
Utils::QtcProcess::addArg(&args, bc->makefile());
|
||||||
}
|
}
|
||||||
|
|
||||||
args.append(m_userArgs);
|
Utils::QtcProcess::addArgs(&args, m_userArgs);
|
||||||
|
|
||||||
if (!m_clean) {
|
if (!m_clean) {
|
||||||
if (!bc->defaultMakeTarget().isEmpty())
|
if (!bc->defaultMakeTarget().isEmpty())
|
||||||
args << bc->defaultMakeTarget();
|
Utils::QtcProcess::addArg(&args, bc->defaultMakeTarget());
|
||||||
}
|
}
|
||||||
// -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the
|
// -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the
|
||||||
// absolute file path
|
// absolute file path
|
||||||
@@ -177,7 +182,7 @@ bool MakeStep::init()
|
|||||||
if (toolchain->type() != ProjectExplorer::ToolChain_MSVC &&
|
if (toolchain->type() != ProjectExplorer::ToolChain_MSVC &&
|
||||||
toolchain->type() != ProjectExplorer::ToolChain_WINCE) {
|
toolchain->type() != ProjectExplorer::ToolChain_WINCE) {
|
||||||
if (m_makeCmd.isEmpty())
|
if (m_makeCmd.isEmpty())
|
||||||
args << "-w";
|
Utils::QtcProcess::addArg(&args, QLatin1String("-w"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,12 +240,12 @@ ProjectExplorer::BuildStepConfigWidget *MakeStep::createConfigWidget()
|
|||||||
return new MakeStepConfigWidget(this);
|
return new MakeStepConfigWidget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList MakeStep::userArguments()
|
QString MakeStep::userArguments()
|
||||||
{
|
{
|
||||||
return m_userArgs;
|
return m_userArgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStep::setUserArguments(const QStringList &arguments)
|
void MakeStep::setUserArguments(const QString &arguments)
|
||||||
{
|
{
|
||||||
m_userArgs = arguments;
|
m_userArgs = arguments;
|
||||||
emit userArgumentsChanged();
|
emit userArgumentsChanged();
|
||||||
@@ -314,16 +319,16 @@ void MakeStepConfigWidget::updateDetails()
|
|||||||
// FIXME doing this without the user having a way to override this is rather bad
|
// FIXME doing this without the user having a way to override this is rather bad
|
||||||
// so we only do it for unix and if the user didn't override the make command
|
// so we only do it for unix and if the user didn't override the make command
|
||||||
// but for now this is the least invasive change
|
// but for now this is the least invasive change
|
||||||
QStringList args = m_makeStep->userArguments();
|
QString args = m_makeStep->userArguments();
|
||||||
ProjectExplorer::ToolChainType t = ProjectExplorer::ToolChain_UNKNOWN;
|
ProjectExplorer::ToolChainType t = ProjectExplorer::ToolChain_UNKNOWN;
|
||||||
ProjectExplorer::ToolChain *toolChain = bc->toolChain();
|
ProjectExplorer::ToolChain *toolChain = bc->toolChain();
|
||||||
if (toolChain)
|
if (toolChain)
|
||||||
t = toolChain->type();
|
t = toolChain->type();
|
||||||
if (t != ProjectExplorer::ToolChain_MSVC && t != ProjectExplorer::ToolChain_WINCE) {
|
if (t != ProjectExplorer::ToolChain_MSVC && t != ProjectExplorer::ToolChain_WINCE) {
|
||||||
if (m_makeStep->m_makeCmd.isEmpty())
|
if (m_makeStep->m_makeCmd.isEmpty())
|
||||||
args << "-w";
|
Utils::QtcProcess::addArg(&args, QLatin1String("-w"));
|
||||||
}
|
}
|
||||||
m_summaryText = tr("<b>Make:</b> %1 %2 in %3").arg(QFileInfo(makeCmd).fileName(), args.join(" "),
|
m_summaryText = tr("<b>Make:</b> %1 %2 in %3").arg(QFileInfo(makeCmd).fileName(), args,
|
||||||
QDir::toNativeSeparators(workingDirectory));
|
QDir::toNativeSeparators(workingDirectory));
|
||||||
emit updateSummary();
|
emit updateSummary();
|
||||||
}
|
}
|
||||||
@@ -342,8 +347,7 @@ void MakeStepConfigWidget::userArgumentsChanged()
|
|||||||
{
|
{
|
||||||
if (m_ignoreChange)
|
if (m_ignoreChange)
|
||||||
return;
|
return;
|
||||||
const QStringList &makeArguments = m_makeStep->userArguments();
|
m_ui->makeArgumentsLineEdit->setText(m_makeStep->userArguments());
|
||||||
m_ui->makeArgumentsLineEdit->setText(Utils::Environment::joinArgumentList(makeArguments));
|
|
||||||
updateDetails();
|
updateDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,8 +358,7 @@ void MakeStepConfigWidget::init()
|
|||||||
const QString &makeCmd = m_makeStep->m_makeCmd;
|
const QString &makeCmd = m_makeStep->m_makeCmd;
|
||||||
m_ui->makePathChooser->setPath(makeCmd);
|
m_ui->makePathChooser->setPath(makeCmd);
|
||||||
|
|
||||||
const QStringList &makeArguments = m_makeStep->userArguments();
|
m_ui->makeArgumentsLineEdit->setText(m_makeStep->userArguments());
|
||||||
m_ui->makeArgumentsLineEdit->setText(Utils::Environment::joinArgumentList(makeArguments));
|
|
||||||
updateDetails();
|
updateDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,8 +371,7 @@ void MakeStepConfigWidget::makeEdited()
|
|||||||
void MakeStepConfigWidget::makeArgumentsLineEdited()
|
void MakeStepConfigWidget::makeArgumentsLineEdited()
|
||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_makeStep->setUserArguments(
|
m_makeStep->setUserArguments(m_ui->makeArgumentsLineEdit->text());
|
||||||
Utils::Environment::parseCombinedArgString(m_ui->makeArgumentsLineEdit->text()));
|
|
||||||
m_ignoreChange = false;
|
m_ignoreChange = false;
|
||||||
updateDetails();
|
updateDetails();
|
||||||
}
|
}
|
||||||
|
@@ -91,8 +91,8 @@ public:
|
|||||||
|
|
||||||
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
|
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
|
||||||
virtual bool immutable() const;
|
virtual bool immutable() const;
|
||||||
QStringList userArguments();
|
QString userArguments();
|
||||||
void setUserArguments(const QStringList &arguments);
|
void setUserArguments(const QString &arguments);
|
||||||
void setClean(bool clean);
|
void setClean(bool clean);
|
||||||
|
|
||||||
QVariantMap toMap() const;
|
QVariantMap toMap() const;
|
||||||
@@ -108,7 +108,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void ctor();
|
void ctor();
|
||||||
bool m_clean;
|
bool m_clean;
|
||||||
QStringList m_userArgs;
|
QString m_userArgs;
|
||||||
QString m_makeCmd;
|
QString m_makeCmd;
|
||||||
ProjectExplorer::GnuMakeParser * m_gnuMakeParser;
|
ProjectExplorer::GnuMakeParser * m_gnuMakeParser;
|
||||||
};
|
};
|
||||||
|
@@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
@@ -100,29 +101,34 @@ Qt4BuildConfiguration *QMakeStep::qt4BuildConfiguration() const
|
|||||||
/// config arguemnts
|
/// config arguemnts
|
||||||
/// moreArguments
|
/// moreArguments
|
||||||
/// user arguments
|
/// user arguments
|
||||||
QStringList QMakeStep::allArguments()
|
QString QMakeStep::allArguments(bool shorted)
|
||||||
{
|
{
|
||||||
QStringList additonalArguments = m_userArgs;
|
QString additonalArguments = m_userArgs;
|
||||||
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
|
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
if (bc->subNodeBuild())
|
if (bc->subNodeBuild())
|
||||||
arguments << QDir::toNativeSeparators(bc->subNodeBuild()->path());
|
arguments << QDir::toNativeSeparators(bc->subNodeBuild()->path());
|
||||||
|
else if (shorted)
|
||||||
|
arguments << QDir::toNativeSeparators(QFileInfo(
|
||||||
|
buildConfiguration()->target()->project()->file()->fileName()).fileName());
|
||||||
else
|
else
|
||||||
arguments << QDir::toNativeSeparators(buildConfiguration()->target()->project()->file()->fileName());
|
arguments << QDir::toNativeSeparators(buildConfiguration()->target()->project()->file()->fileName());
|
||||||
arguments << "-r";
|
arguments << "-r";
|
||||||
|
|
||||||
if (!additonalArguments.contains("-spec"))
|
for (Utils::QtcProcess::ArgIterator ait(&additonalArguments); ait.next(); )
|
||||||
arguments << "-spec" << bc->qtVersion()->mkspec();
|
if (ait.value() == QLatin1String("-spec"))
|
||||||
|
goto haveSpec;
|
||||||
|
arguments << "-spec" << bc->qtVersion()->mkspec();
|
||||||
|
haveSpec:
|
||||||
|
|
||||||
// Find out what flags we pass on to qmake
|
// Find out what flags we pass on to qmake
|
||||||
arguments << bc->configCommandLineArguments();
|
arguments << bc->configCommandLineArguments();
|
||||||
|
|
||||||
if (!additonalArguments.isEmpty())
|
|
||||||
arguments << additonalArguments;
|
|
||||||
|
|
||||||
arguments << moreArguments();
|
arguments << moreArguments();
|
||||||
|
|
||||||
return arguments;
|
QString args = Utils::QtcProcess::joinArgs(arguments);
|
||||||
|
Utils::QtcProcess::addArgs(&args, additonalArguments);
|
||||||
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -164,7 +170,7 @@ bool QMakeStep::init()
|
|||||||
Qt4BuildConfiguration *qt4bc = qt4BuildConfiguration();
|
Qt4BuildConfiguration *qt4bc = qt4BuildConfiguration();
|
||||||
const QtVersion *qtVersion = qt4bc->qtVersion();
|
const QtVersion *qtVersion = qt4bc->qtVersion();
|
||||||
|
|
||||||
QStringList args = allArguments();
|
QString args = allArguments();
|
||||||
QString workingDirectory;
|
QString workingDirectory;
|
||||||
|
|
||||||
if (qt4bc->subNodeBuild())
|
if (qt4bc->subNodeBuild())
|
||||||
@@ -286,7 +292,7 @@ bool QMakeStep::processSucceeded(int exitCode, QProcess::ExitStatus status)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMakeStep::setUserArguments(const QStringList &arguments)
|
void QMakeStep::setUserArguments(const QString &arguments)
|
||||||
{
|
{
|
||||||
if (m_userArgs == arguments)
|
if (m_userArgs == arguments)
|
||||||
return;
|
return;
|
||||||
@@ -301,14 +307,13 @@ void QMakeStep::setUserArguments(const QStringList &arguments)
|
|||||||
QStringList QMakeStep::parserArguments()
|
QStringList QMakeStep::parserArguments()
|
||||||
{
|
{
|
||||||
QStringList result;
|
QStringList result;
|
||||||
foreach (const QString &str, allArguments()) {
|
for (Utils::QtcProcess::ConstArgIterator ait(allArguments()); ait.next(); )
|
||||||
if (str.contains("="))
|
if (ait.value().contains(QLatin1Char('=')))
|
||||||
result << str;
|
result << ait.value();
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QMakeStep::userArguments()
|
QString QMakeStep::userArguments()
|
||||||
{
|
{
|
||||||
return m_userArgs;
|
return m_userArgs;
|
||||||
}
|
}
|
||||||
@@ -322,7 +327,7 @@ QVariantMap QMakeStep::toMap() const
|
|||||||
|
|
||||||
bool QMakeStep::fromMap(const QVariantMap &map)
|
bool QMakeStep::fromMap(const QVariantMap &map)
|
||||||
{
|
{
|
||||||
m_userArgs = map.value(QLatin1String(QMAKE_ARGUMENTS_KEY)).toStringList();
|
m_userArgs = map.value(QLatin1String(QMAKE_ARGUMENTS_KEY)).toString();
|
||||||
|
|
||||||
return BuildStep::fromMap(map);
|
return BuildStep::fromMap(map);
|
||||||
}
|
}
|
||||||
@@ -349,8 +354,7 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
|
|||||||
|
|
||||||
void QMakeStepConfigWidget::init()
|
void QMakeStepConfigWidget::init()
|
||||||
{
|
{
|
||||||
QString qmakeArgs = Utils::Environment::joinArgumentList(m_step->userArguments());
|
m_ui.qmakeAdditonalArgumentsLineEdit->setText(m_step->userArguments());
|
||||||
m_ui.qmakeAdditonalArgumentsLineEdit->setText(qmakeArgs);
|
|
||||||
|
|
||||||
qmakeBuildConfigChanged();
|
qmakeBuildConfigChanged();
|
||||||
|
|
||||||
@@ -393,8 +397,7 @@ void QMakeStepConfigWidget::userArgumentsChanged()
|
|||||||
{
|
{
|
||||||
if (m_ignoreChange)
|
if (m_ignoreChange)
|
||||||
return;
|
return;
|
||||||
QString qmakeArgs = Utils::Environment::joinArgumentList(m_step->userArguments());
|
m_ui.qmakeAdditonalArgumentsLineEdit->setText(m_step->userArguments());
|
||||||
m_ui.qmakeAdditonalArgumentsLineEdit->setText(qmakeArgs);
|
|
||||||
updateSummaryLabel();
|
updateSummaryLabel();
|
||||||
updateEffectiveQMakeCall();
|
updateEffectiveQMakeCall();
|
||||||
}
|
}
|
||||||
@@ -402,8 +405,7 @@ void QMakeStepConfigWidget::userArgumentsChanged()
|
|||||||
void QMakeStepConfigWidget::qmakeArgumentsLineEdited()
|
void QMakeStepConfigWidget::qmakeArgumentsLineEdited()
|
||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_step->setUserArguments(
|
m_step->setUserArguments(m_ui.qmakeAdditonalArgumentsLineEdit->text());
|
||||||
Utils::Environment::parseCombinedArgString(m_ui.qmakeAdditonalArgumentsLineEdit->text()));
|
|
||||||
m_ignoreChange = false;
|
m_ignoreChange = false;
|
||||||
|
|
||||||
updateSummaryLabel();
|
updateSummaryLabel();
|
||||||
@@ -446,16 +448,11 @@ void QMakeStepConfigWidget::updateSummaryLabel()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList args = m_step->allArguments();
|
|
||||||
// We don't want the full path to the .pro file
|
// We don't want the full path to the .pro file
|
||||||
const QString projectFileName = m_step->buildConfiguration()->target()->project()->file()->fileName();
|
QString args = m_step->allArguments(true);
|
||||||
int index = args.indexOf(projectFileName);
|
|
||||||
if (index != -1)
|
|
||||||
args[index] = QFileInfo(projectFileName).fileName();
|
|
||||||
|
|
||||||
// And we only use the .pro filename not the full path
|
// And we only use the .pro filename not the full path
|
||||||
QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
|
QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
|
||||||
m_summaryText = tr("<b>qmake:</b> %1 %2").arg(program, args.join(QString(QLatin1Char(' '))));
|
m_summaryText = tr("<b>qmake:</b> %1 %2").arg(program, args);
|
||||||
emit updateSummary();
|
emit updateSummary();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -465,7 +462,7 @@ void QMakeStepConfigWidget::updateEffectiveQMakeCall()
|
|||||||
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
||||||
const QtVersion *qtVersion = qt4bc->qtVersion();
|
const QtVersion *qtVersion = qt4bc->qtVersion();
|
||||||
QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
|
QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
|
||||||
m_ui.qmakeArgumentsEdit->setPlainText(program + QLatin1Char(' ') + Utils::Environment::joinArgumentList(m_step->allArguments()));
|
m_ui.qmakeArgumentsEdit->setPlainText(program + QLatin1Char(' ') + m_step->allArguments());
|
||||||
}
|
}
|
||||||
|
|
||||||
////
|
////
|
||||||
|
@@ -86,11 +86,11 @@ public:
|
|||||||
bool forced();
|
bool forced();
|
||||||
|
|
||||||
// TODO clean up those functions
|
// TODO clean up those functions
|
||||||
QStringList allArguments();
|
QString allArguments(bool shorted = false);
|
||||||
QStringList moreArguments();
|
QStringList moreArguments();
|
||||||
QStringList parserArguments();
|
QStringList parserArguments();
|
||||||
QStringList userArguments();
|
QString userArguments();
|
||||||
void setUserArguments(const QStringList &arguments);
|
void setUserArguments(const QString &arguments);
|
||||||
|
|
||||||
QVariantMap toMap() const;
|
QVariantMap toMap() const;
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ private:
|
|||||||
QStringList m_lastEnv;
|
QStringList m_lastEnv;
|
||||||
bool m_forced;
|
bool m_forced;
|
||||||
bool m_needToRunQMake; // set in init(), read in run()
|
bool m_needToRunQMake; // set in init(), read in run()
|
||||||
QStringList m_userArgs;
|
QString m_userArgs;
|
||||||
bool m_scriptTemplate;
|
bool m_scriptTemplate;
|
||||||
QList<ProjectExplorer::Task> m_tasks;
|
QList<ProjectExplorer::Task> m_tasks;
|
||||||
};
|
};
|
||||||
|
@@ -270,7 +270,7 @@ void MaemoDebugSupport::startDebugging()
|
|||||||
const QString cmdPrefix = MaemoGlobal::remoteCommandPrefix(remoteExe);
|
const QString cmdPrefix = MaemoGlobal::remoteCommandPrefix(remoteExe);
|
||||||
const QString env
|
const QString env
|
||||||
= environment(m_debuggingType, m_runner->userEnvChanges());
|
= environment(m_debuggingType, m_runner->userEnvChanges());
|
||||||
const QString args = m_runner->arguments().join(QLatin1String(" "));
|
const QString args = m_runner->arguments();
|
||||||
const QString remoteCommandLine
|
const QString remoteCommandLine
|
||||||
= m_debuggingType == MaemoRunConfiguration::DebugQmlOnly
|
= m_debuggingType == MaemoRunConfiguration::DebugQmlOnly
|
||||||
? QString::fromLocal8Bit("%1 %2 %3 %4").arg(cmdPrefix).arg(env)
|
? QString::fromLocal8Bit("%1 %2 %3 %4").arg(cmdPrefix).arg(env)
|
||||||
|
@@ -49,6 +49,7 @@
|
|||||||
#include <qt4projectmanager/qt4project.h>
|
#include <qt4projectmanager/qt4project.h>
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QtCore/QStringBuilder>
|
#include <QtCore/QStringBuilder>
|
||||||
|
|
||||||
@@ -185,7 +186,7 @@ bool MaemoRunConfiguration::fromMap(const QVariantMap &map)
|
|||||||
if (!RunConfiguration::fromMap(map))
|
if (!RunConfiguration::fromMap(map))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_arguments = map.value(ArgumentsKey).toStringList();
|
m_arguments = map.value(ArgumentsKey).toString();
|
||||||
const QDir dir = QDir(target()->project()->projectDirectory());
|
const QDir dir = QDir(target()->project()->projectDirectory());
|
||||||
m_proFilePath = dir.filePath(map.value(ProFileKey).toString());
|
m_proFilePath = dir.filePath(map.value(ProFileKey).toString());
|
||||||
m_useRemoteGdb = map.value(UseRemoteGdbKey, DefaultUseRemoteGdbValue).toBool();
|
m_useRemoteGdb = map.value(UseRemoteGdbKey, DefaultUseRemoteGdbValue).toBool();
|
||||||
@@ -262,7 +263,7 @@ const QString MaemoRunConfiguration::targetRoot() const
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QStringList MaemoRunConfiguration::arguments() const
|
const QString MaemoRunConfiguration::arguments() const
|
||||||
{
|
{
|
||||||
return m_arguments;
|
return m_arguments;
|
||||||
}
|
}
|
||||||
@@ -334,7 +335,7 @@ bool MaemoRunConfiguration::useRemoteGdb() const
|
|||||||
return m_useRemoteGdb && toolchain()->allowsRemoteMounts();
|
return m_useRemoteGdb && toolchain()->allowsRemoteMounts();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfiguration::setArguments(const QStringList &args)
|
void MaemoRunConfiguration::setArguments(const QString &args)
|
||||||
{
|
{
|
||||||
m_arguments = args;
|
m_arguments = args;
|
||||||
}
|
}
|
||||||
|
@@ -92,8 +92,8 @@ public:
|
|||||||
QString remoteExecutableFilePath() const;
|
QString remoteExecutableFilePath() const;
|
||||||
const QString sysRoot() const;
|
const QString sysRoot() const;
|
||||||
const QString targetRoot() const;
|
const QString targetRoot() const;
|
||||||
const QStringList arguments() const;
|
const QString arguments() const;
|
||||||
void setArguments(const QStringList &args);
|
void setArguments(const QString &args);
|
||||||
MaemoDeviceConfig deviceConfig() const;
|
MaemoDeviceConfig deviceConfig() const;
|
||||||
MaemoPortList freePorts() const;
|
MaemoPortList freePorts() const;
|
||||||
bool useRemoteGdb() const;
|
bool useRemoteGdb() const;
|
||||||
@@ -149,7 +149,7 @@ private:
|
|||||||
QString m_proFilePath;
|
QString m_proFilePath;
|
||||||
mutable QString m_gdbPath;
|
mutable QString m_gdbPath;
|
||||||
MaemoRemoteMountsModel *m_remoteMounts;
|
MaemoRemoteMountsModel *m_remoteMounts;
|
||||||
QStringList m_arguments;
|
QString m_arguments;
|
||||||
bool m_useRemoteGdb;
|
bool m_useRemoteGdb;
|
||||||
|
|
||||||
BaseEnvironmentBase m_baseEnvironmentBase;
|
BaseEnvironmentBase m_baseEnvironmentBase;
|
||||||
|
@@ -137,7 +137,7 @@ void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
|
|||||||
formLayout->addRow(tr("Executable on host:"), m_localExecutableLabel);
|
formLayout->addRow(tr("Executable on host:"), m_localExecutableLabel);
|
||||||
m_remoteExecutableLabel = new QLabel;
|
m_remoteExecutableLabel = new QLabel;
|
||||||
formLayout->addRow(tr("Executable on device:"), m_remoteExecutableLabel);
|
formLayout->addRow(tr("Executable on device:"), m_remoteExecutableLabel);
|
||||||
m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments().join(" "));
|
m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments());
|
||||||
formLayout->addRow(tr("Arguments:"), m_argsLineEdit);
|
formLayout->addRow(tr("Arguments:"), m_argsLineEdit);
|
||||||
|
|
||||||
QHBoxLayout * const debugButtonsLayout = new QHBoxLayout;
|
QHBoxLayout * const debugButtonsLayout = new QHBoxLayout;
|
||||||
@@ -293,7 +293,7 @@ void MaemoRunConfigurationWidget::addEnvironmentWidgets(QVBoxLayout *mainLayout)
|
|||||||
|
|
||||||
void MaemoRunConfigurationWidget::argumentsEdited(const QString &text)
|
void MaemoRunConfigurationWidget::argumentsEdited(const QString &text)
|
||||||
{
|
{
|
||||||
m_runConfiguration->setArguments(text.split(' ', QString::SkipEmptyParts));
|
m_runConfiguration->setArguments(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::updateTargetInformation()
|
void MaemoRunConfigurationWidget::updateTargetInformation()
|
||||||
|
@@ -104,7 +104,7 @@ void MaemoRunControl::startExecution()
|
|||||||
.arg(MaemoGlobal::remoteCommandPrefix(m_runner->remoteExecutable()))
|
.arg(MaemoGlobal::remoteCommandPrefix(m_runner->remoteExecutable()))
|
||||||
.arg(MaemoGlobal::remoteEnvironment(m_runner->userEnvChanges()))
|
.arg(MaemoGlobal::remoteEnvironment(m_runner->userEnvChanges()))
|
||||||
.arg(m_runner->remoteExecutable())
|
.arg(m_runner->remoteExecutable())
|
||||||
.arg(m_runner->arguments().join(QLatin1String(" "))).toUtf8());
|
.arg(m_runner->arguments()).toUtf8());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunControl::handleRemoteProcessFinished(qint64 exitCode)
|
void MaemoRunControl::handleRemoteProcessFinished(qint64 exitCode)
|
||||||
|
@@ -74,7 +74,7 @@ public:
|
|||||||
MaemoPortList *freePorts() { return &m_freePorts; }
|
MaemoPortList *freePorts() { return &m_freePorts; }
|
||||||
MaemoDeviceConfig deviceConfig() const { return m_devConfig; }
|
MaemoDeviceConfig deviceConfig() const { return m_devConfig; }
|
||||||
QString remoteExecutable() const { return m_remoteExecutable; }
|
QString remoteExecutable() const { return m_remoteExecutable; }
|
||||||
QStringList arguments() const { return m_appArguments; }
|
QString arguments() const { return m_appArguments; }
|
||||||
QList<Utils::EnvironmentItem> userEnvChanges() const { return m_userEnvChanges; }
|
QList<Utils::EnvironmentItem> userEnvChanges() const { return m_userEnvChanges; }
|
||||||
|
|
||||||
static const qint64 InvalidExitCode;
|
static const qint64 InvalidExitCode;
|
||||||
@@ -118,7 +118,7 @@ private:
|
|||||||
MaemoUsedPortsGatherer * const m_portsGatherer;
|
MaemoUsedPortsGatherer * const m_portsGatherer;
|
||||||
const MaemoDeviceConfig m_devConfig;
|
const MaemoDeviceConfig m_devConfig;
|
||||||
const QString m_remoteExecutable;
|
const QString m_remoteExecutable;
|
||||||
const QStringList m_appArguments;
|
const QString m_appArguments;
|
||||||
const QList<Utils::EnvironmentItem> m_userEnvChanges;
|
const QList<Utils::EnvironmentItem> m_userEnvChanges;
|
||||||
const MaemoPortList m_initialFreePorts;
|
const MaemoPortList m_initialFreePorts;
|
||||||
QList<MaemoMountSpecification> m_mountSpecs;
|
QList<MaemoMountSpecification> m_mountSpecs;
|
||||||
|
@@ -225,7 +225,7 @@ bool S60DeviceRunConfiguration::fromMap(const QVariantMap &map)
|
|||||||
const QDir projectDir = QDir(target()->project()->projectDirectory());
|
const QDir projectDir = QDir(target()->project()->projectDirectory());
|
||||||
|
|
||||||
m_proFilePath = projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString());
|
m_proFilePath = projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString());
|
||||||
m_commandLineArguments = map.value(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY)).toStringList();
|
m_commandLineArguments = map.value(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY)).toString();
|
||||||
|
|
||||||
if (m_proFilePath.isEmpty())
|
if (m_proFilePath.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
@@ -368,12 +368,12 @@ QString S60DeviceRunConfiguration::projectFilePath() const
|
|||||||
return m_proFilePath;
|
return m_proFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList S60DeviceRunConfiguration::commandLineArguments() const
|
QString S60DeviceRunConfiguration::commandLineArguments() const
|
||||||
{
|
{
|
||||||
return m_commandLineArguments;
|
return m_commandLineArguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
void S60DeviceRunConfiguration::setCommandLineArguments(const QStringList &args)
|
void S60DeviceRunConfiguration::setCommandLineArguments(const QString &args)
|
||||||
{
|
{
|
||||||
m_commandLineArguments = args;
|
m_commandLineArguments = args;
|
||||||
}
|
}
|
||||||
|
@@ -77,8 +77,8 @@ public:
|
|||||||
|
|
||||||
ProjectExplorer::OutputFormatter *createOutputFormatter() const;
|
ProjectExplorer::OutputFormatter *createOutputFormatter() const;
|
||||||
|
|
||||||
QStringList commandLineArguments() const;
|
QString commandLineArguments() const;
|
||||||
void setCommandLineArguments(const QStringList &args);
|
void setCommandLineArguments(const QString &args);
|
||||||
|
|
||||||
QString projectFilePath() const;
|
QString projectFilePath() const;
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ private:
|
|||||||
void handleParserState(bool sucess);
|
void handleParserState(bool sucess);
|
||||||
|
|
||||||
QString m_proFilePath;
|
QString m_proFilePath;
|
||||||
QStringList m_commandLineArguments;
|
QString m_commandLineArguments;
|
||||||
bool m_validParse;
|
bool m_validParse;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ private:
|
|||||||
QString m_serialPortName;
|
QString m_serialPortName;
|
||||||
QString m_serialPortFriendlyName;
|
QString m_serialPortFriendlyName;
|
||||||
QString m_targetName;
|
QString m_targetName;
|
||||||
QStringList m_commandLineArguments;
|
QString m_commandLineArguments;
|
||||||
QString m_executableFileName;
|
QString m_executableFileName;
|
||||||
QString m_qtDir;
|
QString m_qtDir;
|
||||||
QString m_qtBinPath;
|
QString m_qtBinPath;
|
||||||
|
@@ -46,7 +46,7 @@ S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget(
|
|||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
m_runConfiguration(runConfiguration),
|
m_runConfiguration(runConfiguration),
|
||||||
m_detailsWidget(new Utils::DetailsWidget),
|
m_detailsWidget(new Utils::DetailsWidget),
|
||||||
m_argumentsLineEdit(new QLineEdit(m_runConfiguration->commandLineArguments().join(QString(QLatin1Char(' ')))))
|
m_argumentsLineEdit(new QLineEdit(m_runConfiguration->commandLineArguments()))
|
||||||
{
|
{
|
||||||
m_detailsWidget->setState(Utils::DetailsWidget::NoSummary);
|
m_detailsWidget->setState(Utils::DetailsWidget::NoSummary);
|
||||||
QVBoxLayout *mainBoxLayout = new QVBoxLayout();
|
QVBoxLayout *mainBoxLayout = new QVBoxLayout();
|
||||||
@@ -76,13 +76,7 @@ S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget(
|
|||||||
|
|
||||||
void S60DeviceRunConfigurationWidget::argumentsEdited(const QString &text)
|
void S60DeviceRunConfigurationWidget::argumentsEdited(const QString &text)
|
||||||
{
|
{
|
||||||
const QString trimmed = text.trimmed();
|
m_runConfiguration->setCommandLineArguments(text.trimmed());
|
||||||
if (trimmed.isEmpty()) {
|
|
||||||
m_runConfiguration->setCommandLineArguments(QStringList());
|
|
||||||
} else {
|
|
||||||
m_runConfiguration->setCommandLineArguments(trimmed.split(QLatin1Char(' '),
|
|
||||||
QString::SkipEmptyParts));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void S60DeviceRunConfigurationWidget::runConfigurationEnabledChange(bool enabled)
|
void S60DeviceRunConfigurationWidget::runConfigurationEnabledChange(bool enabled)
|
||||||
|
@@ -327,7 +327,7 @@ S60EmulatorRunControl::S60EmulatorRunControl(S60EmulatorRunConfiguration *runCon
|
|||||||
// stuff like the EPOCROOT and EPOCDEVICE env variable
|
// stuff like the EPOCROOT and EPOCDEVICE env variable
|
||||||
Utils::Environment env = Utils::Environment::systemEnvironment();
|
Utils::Environment env = Utils::Environment::systemEnvironment();
|
||||||
runConfiguration->qt4Target()->activeBuildConfiguration()->toolChain()->addToEnvironment(env);
|
runConfiguration->qt4Target()->activeBuildConfiguration()->toolChain()->addToEnvironment(env);
|
||||||
m_applicationLauncher.setEnvironment(env.toStringList());
|
m_applicationLauncher.setEnvironment(env);
|
||||||
|
|
||||||
m_executable = runConfiguration->executable();
|
m_executable = runConfiguration->executable();
|
||||||
connect(&m_applicationLauncher, SIGNAL(applicationError(QString)),
|
connect(&m_applicationLauncher, SIGNAL(applicationError(QString)),
|
||||||
@@ -342,7 +342,7 @@ S60EmulatorRunControl::S60EmulatorRunControl(S60EmulatorRunConfiguration *runCon
|
|||||||
|
|
||||||
void S60EmulatorRunControl::start()
|
void S60EmulatorRunControl::start()
|
||||||
{
|
{
|
||||||
m_applicationLauncher.start(ApplicationLauncher::Gui, m_executable, QStringList());
|
m_applicationLauncher.start(ApplicationLauncher::Gui, m_executable, QString());
|
||||||
emit started();
|
emit started();
|
||||||
|
|
||||||
emit appendMessage(this, tr("Starting %1...").arg(QDir::toNativeSeparators(m_executable)), false);
|
emit appendMessage(this, tr("Starting %1...").arg(QDir::toNativeSeparators(m_executable)), false);
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
#include "makestep.h"
|
#include "makestep.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
@@ -494,7 +495,7 @@ bool Qt4BuildConfiguration::compareToImportFrom(const QString &makefile)
|
|||||||
QtVersion *version = qtVersion();
|
QtVersion *version = qtVersion();
|
||||||
if (version->qmakeCommand() == qmakePath) {
|
if (version->qmakeCommand() == qmakePath) {
|
||||||
// same qtversion
|
// same qtversion
|
||||||
QPair<QtVersion::QmakeBuildConfigs, QStringList> result =
|
QPair<QtVersion::QmakeBuildConfigs, QString> result =
|
||||||
QtVersionManager::scanMakeFile(makefile, version->defaultBuildConfig());
|
QtVersionManager::scanMakeFile(makefile, version->defaultBuildConfig());
|
||||||
if (qmakeBuildConfiguration() == result.first) {
|
if (qmakeBuildConfiguration() == result.first) {
|
||||||
// The qmake Build Configuration are the same,
|
// The qmake Build Configuration are the same,
|
||||||
@@ -502,18 +503,18 @@ bool Qt4BuildConfiguration::compareToImportFrom(const QString &makefile)
|
|||||||
// we have to compare without the spec/platform cmd argument
|
// we have to compare without the spec/platform cmd argument
|
||||||
// and compare that on its own
|
// and compare that on its own
|
||||||
QString workingDirectory = QFileInfo(makefile).absolutePath();
|
QString workingDirectory = QFileInfo(makefile).absolutePath();
|
||||||
QString actualSpec = extractSpecFromArgumentList(qs->userArguments(), workingDirectory, version);
|
QString userArgs = qs->userArguments();
|
||||||
|
QStringList actualArgs;
|
||||||
|
QString actualSpec = extractSpecFromArguments(&userArgs, workingDirectory, version, &actualArgs);
|
||||||
if (actualSpec.isEmpty()) {
|
if (actualSpec.isEmpty()) {
|
||||||
// Easy one: the user has chosen not to override the settings
|
// Easy one: the user has chosen not to override the settings
|
||||||
actualSpec = version->mkspec();
|
actualSpec = version->mkspec();
|
||||||
}
|
}
|
||||||
|
actualArgs += qs->moreArguments();
|
||||||
|
|
||||||
|
QString qmakeArgs = result.second;
|
||||||
QString parsedSpec = extractSpecFromArgumentList(result.second, workingDirectory, version);
|
QStringList parsedArgs;
|
||||||
QStringList actualArgs = qs->moreArguments();
|
QString parsedSpec = extractSpecFromArguments(&qmakeArgs, workingDirectory, version, &parsedArgs);
|
||||||
actualArgs << qs->userArguments();
|
|
||||||
actualArgs = removeSpecFromArgumentList(actualArgs);
|
|
||||||
QStringList parsedArgs = removeSpecFromArgumentList(result.second);
|
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
qDebug()<<"Actual args:"<<actualArgs;
|
qDebug()<<"Actual args:"<<actualArgs;
|
||||||
@@ -558,59 +559,53 @@ bool Qt4BuildConfiguration::compareToImportFrom(const QString &makefile)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList Qt4BuildConfiguration::removeQMLInspectorFromArgumentList(const QStringList &old)
|
void Qt4BuildConfiguration::removeQMLInspectorFromArguments(QString *args)
|
||||||
{
|
{
|
||||||
QStringList result;
|
for (Utils::QtcProcess::ArgIterator ait(args); ait.next(); )
|
||||||
foreach (const QString &str, old)
|
if (ait.value().startsWith(QLatin1String(Constants::QMAKEVAR_QMLJSDEBUGGER_PATH)))
|
||||||
if (!str.startsWith(QLatin1String(Constants::QMAKEVAR_QMLJSDEBUGGER_PATH)))
|
ait.deleteArg();
|
||||||
result << str;
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// We match -spec and -platfrom separetly
|
QString Qt4BuildConfiguration::extractSpecFromArguments(QString *args,
|
||||||
// We ignore -cache, because qmake contained a bug that it didn't
|
const QString &directory, const QtVersion *version,
|
||||||
// mention the -cache in the Makefile
|
QStringList *outArgs)
|
||||||
// That means changing the -cache option in the additional arguments
|
|
||||||
// does not automatically rerun qmake. Alas, we could try more
|
|
||||||
// intelligent matching for -cache, but i guess people rarely
|
|
||||||
// do use that.
|
|
||||||
|
|
||||||
QStringList Qt4BuildConfiguration::removeSpecFromArgumentList(const QStringList &old)
|
|
||||||
{
|
{
|
||||||
if (!old.contains("-spec") && !old.contains("-platform") && !old.contains("-cache"))
|
QString parsedSpec;
|
||||||
return old;
|
|
||||||
QStringList newList;
|
|
||||||
bool ignoreNext = false;
|
bool ignoreNext = false;
|
||||||
foreach(const QString &item, old) {
|
bool nextIsSpec = false;
|
||||||
|
for (Utils::QtcProcess::ArgIterator ait(args); ait.next(); ) {
|
||||||
if (ignoreNext) {
|
if (ignoreNext) {
|
||||||
ignoreNext = false;
|
ignoreNext = false;
|
||||||
} else if (item == "-spec" || item == "-platform" || item == "-cache") {
|
ait.deleteArg();
|
||||||
|
} else if (nextIsSpec) {
|
||||||
|
nextIsSpec = false;
|
||||||
|
parsedSpec = QDir::cleanPath(ait.value());
|
||||||
|
ait.deleteArg();
|
||||||
|
} else if (ait.value() == QLatin1String("-spec") || ait.value() == QLatin1String("-platform")) {
|
||||||
|
nextIsSpec = true;
|
||||||
|
ait.deleteArg();
|
||||||
|
} else if (ait.value() == QLatin1String("-cache")) {
|
||||||
|
// We ignore -cache, because qmake contained a bug that it didn't
|
||||||
|
// mention the -cache in the Makefile.
|
||||||
|
// That means changing the -cache option in the additional arguments
|
||||||
|
// does not automatically rerun qmake. Alas, we could try more
|
||||||
|
// intelligent matching for -cache, but i guess people rarely
|
||||||
|
// do use that.
|
||||||
ignoreNext = true;
|
ignoreNext = true;
|
||||||
} else {
|
ait.deleteArg();
|
||||||
newList << item;
|
} else if (outArgs && ait.isSimple()) {
|
||||||
|
outArgs->append(ait.value());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return newList;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString Qt4BuildConfiguration::extractSpecFromArgumentList(const QStringList &list, QString directory, QtVersion *version)
|
if (parsedSpec.isEmpty())
|
||||||
{
|
|
||||||
int index = list.indexOf("-spec");
|
|
||||||
if (index == -1)
|
|
||||||
index = list.indexOf("-platform");
|
|
||||||
if (index == -1)
|
|
||||||
return QString();
|
|
||||||
|
|
||||||
++index;
|
|
||||||
|
|
||||||
if (index >= list.length())
|
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
QString baseMkspecDir = version->versionInfo().value("QMAKE_MKSPECS");
|
QString baseMkspecDir = version->versionInfo().value("QMAKE_MKSPECS");
|
||||||
if (baseMkspecDir.isEmpty())
|
if (baseMkspecDir.isEmpty())
|
||||||
baseMkspecDir = version->versionInfo().value("QT_INSTALL_DATA") + "/mkspecs";
|
baseMkspecDir = version->versionInfo().value("QT_INSTALL_DATA") + "/mkspecs";
|
||||||
|
|
||||||
QString parsedSpec = QDir::cleanPath(list.at(index));
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
baseMkspecDir = baseMkspecDir.toLower();
|
baseMkspecDir = baseMkspecDir.toLower();
|
||||||
parsedSpec = parsedSpec.toLower();
|
parsedSpec = parsedSpec.toLower();
|
||||||
@@ -753,12 +748,12 @@ BuildConfiguration *Qt4BuildConfigurationFactory::create(ProjectExplorer::Target
|
|||||||
qt4Target->addQt4BuildConfiguration(tr("%1 Debug").arg(buildConfigurationName),
|
qt4Target->addQt4BuildConfiguration(tr("%1 Debug").arg(buildConfigurationName),
|
||||||
version,
|
version,
|
||||||
(version->defaultBuildConfig() | QtVersion::DebugBuild),
|
(version->defaultBuildConfig() | QtVersion::DebugBuild),
|
||||||
QStringList(), QString());
|
QString(), QString());
|
||||||
BuildConfiguration *bc =
|
BuildConfiguration *bc =
|
||||||
qt4Target->addQt4BuildConfiguration(tr("%1 Release").arg(buildConfigurationName),
|
qt4Target->addQt4BuildConfiguration(tr("%1 Release").arg(buildConfigurationName),
|
||||||
version,
|
version,
|
||||||
(version->defaultBuildConfig() & ~QtVersion::DebugBuild),
|
(version->defaultBuildConfig() & ~QtVersion::DebugBuild),
|
||||||
QStringList(), QString());
|
QString(), QString());
|
||||||
return bc;
|
return bc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -109,9 +109,10 @@ public:
|
|||||||
QString makefile() const;
|
QString makefile() const;
|
||||||
|
|
||||||
bool compareToImportFrom(const QString &makefile);
|
bool compareToImportFrom(const QString &makefile);
|
||||||
static QStringList removeQMLInspectorFromArgumentList(const QStringList &old);
|
static void removeQMLInspectorFromArguments(QString *args);
|
||||||
static QStringList removeSpecFromArgumentList(const QStringList &old);
|
static QString extractSpecFromArguments(QString *arguments,
|
||||||
static QString extractSpecFromArgumentList(const QStringList &list, QString directory, QtVersion *version);
|
const QString &directory, const QtVersion *version,
|
||||||
|
QStringList *outArgs = 0);
|
||||||
|
|
||||||
QVariantMap toMap() const;
|
QVariantMap toMap() const;
|
||||||
|
|
||||||
|
@@ -43,6 +43,7 @@
|
|||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <QtGui/QFileDialog>
|
#include <QtGui/QFileDialog>
|
||||||
@@ -416,20 +417,22 @@ void Qt4ProjectConfigWidget::importLabelClicked()
|
|||||||
vm->addVersion(version);
|
vm->addVersion(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
QPair<QtVersion::QmakeBuildConfigs, QStringList> result =
|
QPair<QtVersion::QmakeBuildConfigs, QString> result =
|
||||||
QtVersionManager::scanMakeFile(directory, version->defaultBuildConfig());
|
QtVersionManager::scanMakeFile(directory, version->defaultBuildConfig());
|
||||||
QtVersion::QmakeBuildConfigs qmakeBuildConfig = result.first;
|
QtVersion::QmakeBuildConfigs qmakeBuildConfig = result.first;
|
||||||
QStringList additionalArguments = Qt4BuildConfiguration::removeSpecFromArgumentList(result.second);
|
|
||||||
QString parsedSpec = Qt4BuildConfiguration::extractSpecFromArgumentList(result.second, directory, version);
|
QString aa = result.second;
|
||||||
|
QString parsedSpec = Qt4BuildConfiguration::extractSpecFromArguments(&aa, directory, version);
|
||||||
QString versionSpec = version->mkspec();
|
QString versionSpec = version->mkspec();
|
||||||
|
QString additionalArguments;
|
||||||
if (parsedSpec.isEmpty() || parsedSpec == versionSpec || parsedSpec == "default") {
|
if (parsedSpec.isEmpty() || parsedSpec == versionSpec || parsedSpec == "default") {
|
||||||
// using the default spec, don't modify additional arguments
|
// using the default spec, don't modify additional arguments
|
||||||
} else {
|
} else {
|
||||||
additionalArguments.prepend(parsedSpec);
|
additionalArguments = "-spec " + Utils::QtcProcess::quoteArg(parsedSpec);
|
||||||
additionalArguments.prepend("-spec");
|
|
||||||
}
|
}
|
||||||
|
Utils::QtcProcess::addArgs(&additionalArguments, aa);
|
||||||
|
|
||||||
additionalArguments = Qt4BuildConfiguration::removeQMLInspectorFromArgumentList(additionalArguments);
|
Qt4BuildConfiguration::removeQMLInspectorFromArguments(&additionalArguments);
|
||||||
|
|
||||||
// So we got all the information now apply it...
|
// So we got all the information now apply it...
|
||||||
m_buildConfiguration->setQtVersion(version);
|
m_buildConfiguration->setQtVersion(version);
|
||||||
@@ -443,16 +446,25 @@ void Qt4ProjectConfigWidget::importLabelClicked()
|
|||||||
// If we are switching to BuildAll we want "release" in there and no "debug"
|
// If we are switching to BuildAll we want "release" in there and no "debug"
|
||||||
// or "debug" in there and no "release"
|
// or "debug" in there and no "release"
|
||||||
// If we are switching to not BuildAl we want neither "release" nor "debug" in there
|
// If we are switching to not BuildAl we want neither "release" nor "debug" in there
|
||||||
QStringList makeCmdArguments = makeStep->userArguments();
|
|
||||||
bool debug = qmakeBuildConfig & QtVersion::DebugBuild;
|
bool debug = qmakeBuildConfig & QtVersion::DebugBuild;
|
||||||
if (qmakeBuildConfig & QtVersion::BuildAll) {
|
bool haveTag = !(qmakeBuildConfig & QtVersion::BuildAll);
|
||||||
makeCmdArguments.removeAll(debug ? "release" : "debug");
|
QString makeCmdArguments = makeStep->userArguments();
|
||||||
if (!makeCmdArguments.contains(debug ? "debug" : "release"))
|
Utils::QtcProcess::ArgIterator ait(&makeCmdArguments);
|
||||||
makeCmdArguments.append(debug ? "debug" : "release");
|
while (ait.next()) {
|
||||||
} else {
|
if (ait.value() == QLatin1String("debug")) {
|
||||||
makeCmdArguments.removeAll("debug");
|
if (!haveTag && debug)
|
||||||
makeCmdArguments.removeAll("release");
|
haveTag = true;
|
||||||
|
else
|
||||||
|
ait.deleteArg();
|
||||||
|
} else if (ait.value() == QLatin1String("release")) {
|
||||||
|
if (!haveTag && !debug)
|
||||||
|
haveTag = true;
|
||||||
|
else
|
||||||
|
ait.deleteArg();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (!haveTag)
|
||||||
|
ait.appendArg(QLatin1String(debug ? "debug" : "release"));
|
||||||
makeStep->setUserArguments(makeCmdArguments);
|
makeStep->setUserArguments(makeCmdArguments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -47,6 +47,7 @@
|
|||||||
#include <projectexplorer/environmenteditmodel.h>
|
#include <projectexplorer/environmenteditmodel.h>
|
||||||
#include <projectexplorer/persistentsettings.h>
|
#include <projectexplorer/persistentsettings.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
#include <utils/detailswidget.h>
|
#include <utils/detailswidget.h>
|
||||||
#include <utils/debuggerlanguagechooser.h>
|
#include <utils/debuggerlanguagechooser.h>
|
||||||
@@ -220,7 +221,7 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
|
|||||||
toplayout->addRow(tr("Executable:"), m_executableLineEdit);
|
toplayout->addRow(tr("Executable:"), m_executableLineEdit);
|
||||||
|
|
||||||
QLabel *argumentsLabel = new QLabel(tr("Arguments:"), this);
|
QLabel *argumentsLabel = new QLabel(tr("Arguments:"), this);
|
||||||
m_argumentsLineEdit = new QLineEdit(Utils::Environment::joinArgumentList(qt4RunConfiguration->baseCommandLineArguments()), this);
|
m_argumentsLineEdit = new QLineEdit(qt4RunConfiguration->commandLineArguments(), this);
|
||||||
argumentsLabel->setBuddy(m_argumentsLineEdit);
|
argumentsLabel->setBuddy(m_argumentsLineEdit);
|
||||||
toplayout->addRow(argumentsLabel, m_argumentsLineEdit);
|
toplayout->addRow(argumentsLabel, m_argumentsLineEdit);
|
||||||
|
|
||||||
@@ -326,7 +327,7 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
|
|||||||
connect(qt4RunConfiguration, SIGNAL(baseWorkingDirectoryChanged(QString)),
|
connect(qt4RunConfiguration, SIGNAL(baseWorkingDirectoryChanged(QString)),
|
||||||
this, SLOT(workingDirectoryChanged(QString)));
|
this, SLOT(workingDirectoryChanged(QString)));
|
||||||
|
|
||||||
connect(qt4RunConfiguration, SIGNAL(baseCommandLineArgumentsChanged(QString)),
|
connect(qt4RunConfiguration, SIGNAL(commandLineArgumentsChanged(QString)),
|
||||||
this, SLOT(commandLineArgumentsChanged(QString)));
|
this, SLOT(commandLineArgumentsChanged(QString)));
|
||||||
connect(qt4RunConfiguration, SIGNAL(runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode)),
|
connect(qt4RunConfiguration, SIGNAL(runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode)),
|
||||||
this, SLOT(runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode)));
|
this, SLOT(runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode)));
|
||||||
@@ -424,7 +425,7 @@ void Qt4RunConfigurationWidget::workingDirectoryReseted()
|
|||||||
void Qt4RunConfigurationWidget::argumentsEdited(const QString &args)
|
void Qt4RunConfigurationWidget::argumentsEdited(const QString &args)
|
||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_qt4RunConfiguration->setBaseCommandLineArguments(args);
|
m_qt4RunConfiguration->setCommandLineArguments(args);
|
||||||
m_ignoreChange = false;
|
m_ignoreChange = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -514,7 +515,7 @@ QVariantMap Qt4RunConfiguration::toMap() const
|
|||||||
bool Qt4RunConfiguration::fromMap(const QVariantMap &map)
|
bool Qt4RunConfiguration::fromMap(const QVariantMap &map)
|
||||||
{
|
{
|
||||||
const QDir projectDir = QDir(target()->project()->projectDirectory());
|
const QDir projectDir = QDir(target()->project()->projectDirectory());
|
||||||
m_commandLineArguments = map.value(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY)).toStringList();
|
m_commandLineArguments = map.value(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY)).toString();
|
||||||
m_proFilePath = projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString());
|
m_proFilePath = projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString());
|
||||||
m_runMode = map.value(QLatin1String(USE_TERMINAL_KEY), false).toBool() ? Console : Gui;
|
m_runMode = map.value(QLatin1String(USE_TERMINAL_KEY), false).toBool() ? Console : Gui;
|
||||||
m_isUsingDyldImageSuffix = map.value(QLatin1String(USE_DYLD_IMAGE_SUFFIX_KEY), false).toBool();
|
m_isUsingDyldImageSuffix = map.value(QLatin1String(USE_DYLD_IMAGE_SUFFIX_KEY), false).toBool();
|
||||||
@@ -573,12 +574,7 @@ QString Qt4RunConfiguration::baseWorkingDirectory() const
|
|||||||
return ti.workingDir;
|
return ti.workingDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList Qt4RunConfiguration::commandLineArguments() const
|
QString Qt4RunConfiguration::commandLineArguments() const
|
||||||
{
|
|
||||||
return environment().expandVariables(baseCommandLineArguments());
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList Qt4RunConfiguration::baseCommandLineArguments() const
|
|
||||||
{
|
{
|
||||||
return m_commandLineArguments;
|
return m_commandLineArguments;
|
||||||
}
|
}
|
||||||
@@ -651,10 +647,10 @@ void Qt4RunConfiguration::setBaseWorkingDirectory(const QString &wd)
|
|||||||
emit baseWorkingDirectoryChanged(newWorkingDirectory);
|
emit baseWorkingDirectoryChanged(newWorkingDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4RunConfiguration::setBaseCommandLineArguments(const QString &argumentsString)
|
void Qt4RunConfiguration::setCommandLineArguments(const QString &argumentsString)
|
||||||
{
|
{
|
||||||
m_commandLineArguments = Utils::Environment::parseCombinedArgString(argumentsString);
|
m_commandLineArguments = argumentsString;
|
||||||
emit baseCommandLineArgumentsChanged(argumentsString);
|
emit commandLineArgumentsChanged(argumentsString);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4RunConfiguration::setRunMode(RunMode runMode)
|
void Qt4RunConfiguration::setRunMode(RunMode runMode)
|
||||||
|
@@ -84,7 +84,7 @@ public:
|
|||||||
virtual QString executable() const;
|
virtual QString executable() const;
|
||||||
virtual RunMode runMode() const;
|
virtual RunMode runMode() const;
|
||||||
virtual QString workingDirectory() const;
|
virtual QString workingDirectory() const;
|
||||||
virtual QStringList commandLineArguments() const;
|
virtual QString commandLineArguments() const;
|
||||||
virtual Utils::Environment environment() const;
|
virtual Utils::Environment environment() const;
|
||||||
virtual QString dumperLibrary() const;
|
virtual QString dumperLibrary() const;
|
||||||
virtual QStringList dumperLibraryLocations() const;
|
virtual QStringList dumperLibraryLocations() const;
|
||||||
@@ -101,7 +101,7 @@ public:
|
|||||||
ProjectExplorer::OutputFormatter *createOutputFormatter() const;
|
ProjectExplorer::OutputFormatter *createOutputFormatter() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void baseCommandLineArgumentsChanged(const QString&);
|
void commandLineArgumentsChanged(const QString&);
|
||||||
void baseWorkingDirectoryChanged(const QString&);
|
void baseWorkingDirectoryChanged(const QString&);
|
||||||
void runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode runMode);
|
void runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode runMode);
|
||||||
void usingDyldImageSuffixChanged(bool);
|
void usingDyldImageSuffixChanged(bool);
|
||||||
@@ -124,8 +124,7 @@ private:
|
|||||||
void setRunMode(RunMode runMode);
|
void setRunMode(RunMode runMode);
|
||||||
void setBaseWorkingDirectory(const QString &workingDirectory);
|
void setBaseWorkingDirectory(const QString &workingDirectory);
|
||||||
QString baseWorkingDirectory() const;
|
QString baseWorkingDirectory() const;
|
||||||
void setBaseCommandLineArguments(const QString &argumentsString);
|
void setCommandLineArguments(const QString &argumentsString);
|
||||||
QStringList baseCommandLineArguments() const;
|
|
||||||
enum BaseEnvironmentBase { CleanEnvironmentBase = 0,
|
enum BaseEnvironmentBase { CleanEnvironmentBase = 0,
|
||||||
SystemEnvironmentBase = 1,
|
SystemEnvironmentBase = 1,
|
||||||
BuildEnvironmentBase = 2 };
|
BuildEnvironmentBase = 2 };
|
||||||
@@ -141,7 +140,7 @@ private:
|
|||||||
QList<Utils::EnvironmentItem> userEnvironmentChanges() const;
|
QList<Utils::EnvironmentItem> userEnvironmentChanges() const;
|
||||||
|
|
||||||
void updateTarget();
|
void updateTarget();
|
||||||
QStringList m_commandLineArguments;
|
QString m_commandLineArguments;
|
||||||
QString m_proFilePath; // Full path to the Application Pro File
|
QString m_proFilePath; // Full path to the Application Pro File
|
||||||
|
|
||||||
// Cached startup sub project information
|
// Cached startup sub project information
|
||||||
|
@@ -274,7 +274,7 @@ Qt4Project *Qt4Target::qt4Project() const
|
|||||||
|
|
||||||
Qt4BuildConfiguration *Qt4Target::addQt4BuildConfiguration(QString displayName, QtVersion *qtversion,
|
Qt4BuildConfiguration *Qt4Target::addQt4BuildConfiguration(QString displayName, QtVersion *qtversion,
|
||||||
QtVersion::QmakeBuildConfigs qmakeBuildConfiguration,
|
QtVersion::QmakeBuildConfigs qmakeBuildConfiguration,
|
||||||
QStringList additionalArguments,
|
QString additionalArguments,
|
||||||
QString directory)
|
QString directory)
|
||||||
{
|
{
|
||||||
Q_ASSERT(qtversion);
|
Q_ASSERT(qtversion);
|
||||||
@@ -297,14 +297,14 @@ Qt4BuildConfiguration *Qt4Target::addQt4BuildConfiguration(QString displayName,
|
|||||||
|
|
||||||
MakeStep* cleanStep = new MakeStep(cleanSteps);
|
MakeStep* cleanStep = new MakeStep(cleanSteps);
|
||||||
cleanStep->setClean(true);
|
cleanStep->setClean(true);
|
||||||
cleanStep->setUserArguments(QStringList() << "clean");
|
cleanStep->setUserArguments("clean");
|
||||||
cleanSteps->insertStep(0, cleanStep);
|
cleanSteps->insertStep(0, cleanStep);
|
||||||
if (!additionalArguments.isEmpty())
|
if (!additionalArguments.isEmpty())
|
||||||
qmakeStep->setUserArguments(additionalArguments);
|
qmakeStep->setUserArguments(additionalArguments);
|
||||||
|
|
||||||
// set some options for qmake and make
|
// set some options for qmake and make
|
||||||
if (qmakeBuildConfiguration & QtVersion::BuildAll) // debug_and_release => explicit targets
|
if (qmakeBuildConfiguration & QtVersion::BuildAll) // debug_and_release => explicit targets
|
||||||
makeStep->setUserArguments(QStringList() << (debug ? "debug" : "release"));
|
makeStep->setUserArguments(debug ? "debug" : "release");
|
||||||
|
|
||||||
bc->setQMakeBuildConfiguration(qmakeBuildConfiguration);
|
bc->setQMakeBuildConfiguration(qmakeBuildConfiguration);
|
||||||
|
|
||||||
|
@@ -47,12 +47,12 @@ class Qt4DeployConfigurationFactory;
|
|||||||
|
|
||||||
struct BuildConfigurationInfo {
|
struct BuildConfigurationInfo {
|
||||||
explicit BuildConfigurationInfo(QtVersion *v = 0, QtVersion::QmakeBuildConfigs bc = QtVersion::QmakeBuildConfig(0),
|
explicit BuildConfigurationInfo(QtVersion *v = 0, QtVersion::QmakeBuildConfigs bc = QtVersion::QmakeBuildConfig(0),
|
||||||
const QStringList &aa = QStringList(), const QString &d = QString()) :
|
const QString &aa = QString(), const QString &d = QString()) :
|
||||||
version(v), buildConfig(bc), additionalArguments(aa), directory(d)
|
version(v), buildConfig(bc), additionalArguments(aa), directory(d)
|
||||||
{ }
|
{ }
|
||||||
QtVersion *version;
|
QtVersion *version;
|
||||||
QtVersion::QmakeBuildConfigs buildConfig;
|
QtVersion::QmakeBuildConfigs buildConfig;
|
||||||
QStringList additionalArguments;
|
QString additionalArguments;
|
||||||
QString directory;
|
QString directory;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ public:
|
|||||||
Internal::Qt4BuildConfiguration *addQt4BuildConfiguration(QString displayName,
|
Internal::Qt4BuildConfiguration *addQt4BuildConfiguration(QString displayName,
|
||||||
QtVersion *qtversion,
|
QtVersion *qtversion,
|
||||||
QtVersion::QmakeBuildConfigs qmakeBuildConfiguration,
|
QtVersion::QmakeBuildConfigs qmakeBuildConfiguration,
|
||||||
QStringList additionalArguments,
|
QString additionalArguments,
|
||||||
QString directory);
|
QString directory);
|
||||||
void addRunConfigurationForPath(const QString &proFilePath);
|
void addRunConfigurationForPath(const QString &proFilePath);
|
||||||
|
|
||||||
|
@@ -49,6 +49,7 @@
|
|||||||
#include <coreplugin/helpmanager.h>
|
#include <coreplugin/helpmanager.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
# include <utils/winutils.h>
|
# include <utils/winutils.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -884,25 +885,21 @@ bool QtVersionManager::makefileIsFor(const QString &makefile, const QString &pro
|
|||||||
return srcFileInfo == proFileInfo;
|
return srcFileInfo == proFileInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPair<QtVersion::QmakeBuildConfigs, QStringList> QtVersionManager::scanMakeFile(const QString &makefile, QtVersion::QmakeBuildConfigs defaultBuildConfig)
|
QPair<QtVersion::QmakeBuildConfigs, QString> QtVersionManager::scanMakeFile(const QString &makefile, QtVersion::QmakeBuildConfigs defaultBuildConfig)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug()<<"ScanMakeFile, the gory details:";
|
qDebug()<<"ScanMakeFile, the gory details:";
|
||||||
QtVersion::QmakeBuildConfigs result = defaultBuildConfig;
|
QtVersion::QmakeBuildConfigs result = defaultBuildConfig;
|
||||||
QStringList result2;
|
QString result2;
|
||||||
|
|
||||||
QString line = findQMakeLine(makefile, QLatin1String("# Command:"));
|
QString line = findQMakeLine(makefile, QLatin1String("# Command:"));
|
||||||
if (!line.isEmpty()) {
|
if (!line.isEmpty()) {
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug()<<"Found line"<<line;
|
qDebug()<<"Found line"<<line;
|
||||||
line = trimLine(line);
|
line = trimLine(line);
|
||||||
QStringList parts = splitLine(line);
|
|
||||||
if (debug)
|
|
||||||
qDebug()<<"Split into"<<parts;
|
|
||||||
QList<QMakeAssignment> assignments;
|
QList<QMakeAssignment> assignments;
|
||||||
QList<QMakeAssignment> afterAssignments;
|
QList<QMakeAssignment> afterAssignments;
|
||||||
QStringList additionalArguments;
|
parseArgs(line, &assignments, &afterAssignments, &result2);
|
||||||
parseParts(parts, &assignments, &afterAssignments, &additionalArguments);
|
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
dumpQMakeAssignments(assignments);
|
dumpQMakeAssignments(assignments);
|
||||||
@@ -918,13 +915,12 @@ QPair<QtVersion::QmakeBuildConfigs, QStringList> QtVersionManager::scanMakeFile(
|
|||||||
if (debug)
|
if (debug)
|
||||||
dumpQMakeAssignments(assignments);
|
dumpQMakeAssignments(assignments);
|
||||||
|
|
||||||
result2.append(additionalArguments);
|
|
||||||
foreach(const QMakeAssignment &qa, assignments)
|
foreach(const QMakeAssignment &qa, assignments)
|
||||||
result2.append(qa.variable + qa.op + qa.value);
|
Utils::QtcProcess::addArg(&result2, qa.variable + qa.op + qa.value);
|
||||||
if (!afterAssignments.isEmpty()) {
|
if (!afterAssignments.isEmpty()) {
|
||||||
result2.append("-after");
|
Utils::QtcProcess::addArg(&result2, QLatin1String("-after"));
|
||||||
foreach(const QMakeAssignment &qa, afterAssignments)
|
foreach(const QMakeAssignment &qa, afterAssignments)
|
||||||
result2.append(qa.variable + qa.op + qa.value);
|
Utils::QtcProcess::addArg(&result2, qa.variable + qa.op + qa.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -965,55 +961,23 @@ QString QtVersionManager::trimLine(const QString line)
|
|||||||
return line.mid(firstSpace).trimmed();
|
return line.mid(firstSpace).trimmed();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QtVersionManager::splitLine(const QString &line)
|
void QtVersionManager::parseArgs(const QString &args, QList<QMakeAssignment> *assignments, QList<QMakeAssignment> *afterAssignments, QString *additionalArguments)
|
||||||
{
|
|
||||||
// Split on each " ", except on those which are escaped
|
|
||||||
// On Unix also remove all escaping
|
|
||||||
// On Windows also, but different escaping
|
|
||||||
bool escape = false;
|
|
||||||
QString currentWord;
|
|
||||||
QStringList results;
|
|
||||||
int length = line.length();
|
|
||||||
for (int i=0; i<length; ++i) {
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
if (line.at(i) == '"') {
|
|
||||||
escape = !escape;
|
|
||||||
} else if (escape || line.at(i) != ' ') {
|
|
||||||
currentWord += line.at(i);
|
|
||||||
} else {
|
|
||||||
results << currentWord;
|
|
||||||
currentWord.clear();;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (escape) {
|
|
||||||
currentWord += line.at(i);
|
|
||||||
escape = false;
|
|
||||||
} else if (line.at(i) == ' ') {
|
|
||||||
results << currentWord;
|
|
||||||
currentWord.clear();
|
|
||||||
} else if (line.at(i) == '\\') {
|
|
||||||
escape = true;
|
|
||||||
} else {
|
|
||||||
currentWord += line.at(i);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
return results;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QtVersionManager::parseParts(const QStringList &parts, QList<QMakeAssignment> *assignments, QList<QMakeAssignment> *afterAssignments, QStringList *additionalArguments)
|
|
||||||
{
|
{
|
||||||
QRegExp regExp("([^\\s\\+-]*)\\s*(\\+=|=|-=|~=)(.*)");
|
QRegExp regExp("([^\\s\\+-]*)\\s*(\\+=|=|-=|~=)(.*)");
|
||||||
bool after = false;
|
bool after = false;
|
||||||
bool ignoreNext = false;
|
bool ignoreNext = false;
|
||||||
foreach (const QString &part, parts) {
|
*additionalArguments = args;
|
||||||
|
Utils::QtcProcess::ArgIterator ait(additionalArguments);
|
||||||
|
while (ait.next()) {
|
||||||
if (ignoreNext) {
|
if (ignoreNext) {
|
||||||
// Ignoring
|
// Ignoring
|
||||||
ignoreNext = false;
|
ignoreNext = false;
|
||||||
} else if (part == "-after") {
|
ait.deleteArg();
|
||||||
|
} else if (ait.value() == QLatin1String("-after")) {
|
||||||
after = true;
|
after = true;
|
||||||
} else if(part.contains('=')) {
|
ait.deleteArg();
|
||||||
if (regExp.exactMatch(part)) {
|
} else if (ait.value().contains(QLatin1Char('='))) {
|
||||||
|
if (regExp.exactMatch(ait.value())) {
|
||||||
QMakeAssignment qa;
|
QMakeAssignment qa;
|
||||||
qa.variable = regExp.cap(1);
|
qa.variable = regExp.cap(1);
|
||||||
qa.op = regExp.cap(2);
|
qa.op = regExp.cap(2);
|
||||||
@@ -1025,21 +989,23 @@ void QtVersionManager::parseParts(const QStringList &parts, QList<QMakeAssignmen
|
|||||||
} else {
|
} else {
|
||||||
qDebug()<<"regexp did not match";
|
qDebug()<<"regexp did not match";
|
||||||
}
|
}
|
||||||
} else if (part == "-o") {
|
ait.deleteArg();
|
||||||
|
} else if (ait.value() == QLatin1String("-o")) {
|
||||||
ignoreNext = true;
|
ignoreNext = true;
|
||||||
} else {
|
ait.deleteArg();
|
||||||
additionalArguments->append(part);
|
#if defined(Q_OS_WIN32)
|
||||||
|
} else if (ait.value() == QLatin1String("-win32")) {
|
||||||
|
#elif defined(Q_OS_MAC)
|
||||||
|
} else if (ait.value() == QLatin1String("-macx")) {
|
||||||
|
#elif defined(Q_OS_QNX6)
|
||||||
|
} else if (ait.value() == QLatin1String("-qnx6")) {
|
||||||
|
#else
|
||||||
|
} else if (ait.value() == QLatin1String("-unix")) {
|
||||||
|
#endif
|
||||||
|
ait.deleteArg();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined(Q_OS_WIN32)
|
ait.deleteArg(); // The .pro file is always the last arg
|
||||||
additionalArguments->removeAll("-win32");
|
|
||||||
#elif defined(Q_OS_MAC)
|
|
||||||
additionalArguments->removeAll("-macx");
|
|
||||||
#elif defined(Q_OS_QNX6)
|
|
||||||
additionalArguments->removeAll("-qnx6");
|
|
||||||
#else
|
|
||||||
additionalArguments->removeAll("-unix");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This function extracts all the CONFIG+=debug, CONFIG+=release
|
/// This function extracts all the CONFIG+=debug, CONFIG+=release
|
||||||
|
@@ -265,9 +265,9 @@ public:
|
|||||||
|
|
||||||
// Static Methods
|
// Static Methods
|
||||||
static bool makefileIsFor(const QString &makefile, const QString &proFile);
|
static bool makefileIsFor(const QString &makefile, const QString &proFile);
|
||||||
static QPair<QtVersion::QmakeBuildConfigs, QStringList> scanMakeFile(const QString &makefile,
|
static QPair<QtVersion::QmakeBuildConfigs, QString> scanMakeFile(const QString &makefile,
|
||||||
QtVersion::QmakeBuildConfigs defaultBuildConfig);
|
QtVersion::QmakeBuildConfigs defaultBuildConfig);
|
||||||
static QString findQMakeBinaryFromMakefile(const QString &makefile);
|
static QString findQMakeBinaryFromMakefile(const QString &directory);
|
||||||
bool isValidId(int id) const;
|
bool isValidId(int id) const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@@ -281,11 +281,10 @@ private:
|
|||||||
static bool equals(QtVersion *a, QtVersion *b);
|
static bool equals(QtVersion *a, QtVersion *b);
|
||||||
static QString findQMakeLine(const QString &directory, const QString &key);
|
static QString findQMakeLine(const QString &directory, const QString &key);
|
||||||
static QString trimLine(const QString line);
|
static QString trimLine(const QString line);
|
||||||
static QStringList splitLine(const QString &line);
|
static void parseArgs(const QString &args,
|
||||||
static void parseParts(const QStringList &parts,
|
QList<QMakeAssignment> *assignments,
|
||||||
QList<QMakeAssignment> *assignments,
|
QList<QMakeAssignment> *afterAssignments,
|
||||||
QList<QMakeAssignment> *afterAssignments,
|
QString *additionalArguments);
|
||||||
QStringList *additionalArguments);
|
|
||||||
static QtVersion::QmakeBuildConfigs qmakeBuildConfigFromCmdArgs(QList<QMakeAssignment> *assignments,
|
static QtVersion::QmakeBuildConfigs qmakeBuildConfigFromCmdArgs(QList<QMakeAssignment> *assignments,
|
||||||
QtVersion::QmakeBuildConfigs defaultBuildConfig);
|
QtVersion::QmakeBuildConfigs defaultBuildConfig);
|
||||||
// Used by QtOptionsPage
|
// Used by QtOptionsPage
|
||||||
|
@@ -40,6 +40,7 @@
|
|||||||
#include <projectexplorer/task.h>
|
#include <projectexplorer/task.h>
|
||||||
#include <projectexplorer/taskhub.h>
|
#include <projectexplorer/taskhub.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QtGui/QAction>
|
#include <QtGui/QAction>
|
||||||
#include <QtGui/QFileDialog>
|
#include <QtGui/QFileDialog>
|
||||||
@@ -415,21 +416,20 @@ TargetSetupPage::recursivelyCheckDirectoryForBuild(const QString &directory, con
|
|||||||
info.isTemporary = true;
|
info.isTemporary = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPair<QtVersion::QmakeBuildConfigs, QStringList> result =
|
QPair<QtVersion::QmakeBuildConfigs, QString> result =
|
||||||
QtVersionManager::scanMakeFile(directory + "/Makefile", info.version->defaultBuildConfig());
|
QtVersionManager::scanMakeFile(directory + "/Makefile", info.version->defaultBuildConfig());
|
||||||
info.buildConfig = result.first;
|
info.buildConfig = result.first;
|
||||||
info.additionalArguments = Qt4BuildConfiguration::removeSpecFromArgumentList(result.second);
|
QString aa = result.second;
|
||||||
|
QString parsedSpec = Qt4BuildConfiguration::extractSpecFromArguments(&aa, directory, info.version);
|
||||||
QString parsedSpec = Qt4BuildConfiguration::extractSpecFromArgumentList(result.second, directory, info.version);
|
|
||||||
QString versionSpec = info.version->mkspec();
|
QString versionSpec = info.version->mkspec();
|
||||||
|
|
||||||
// Compare mkspecs and add to additional arguments
|
// Compare mkspecs and add to additional arguments
|
||||||
if (parsedSpec.isEmpty() || parsedSpec == versionSpec || parsedSpec == "default") {
|
if (parsedSpec.isEmpty() || parsedSpec == versionSpec || parsedSpec == "default") {
|
||||||
// using the default spec, don't modify additional arguments
|
// using the default spec, don't modify additional arguments
|
||||||
} else {
|
} else {
|
||||||
info.additionalArguments.prepend(parsedSpec);
|
info.additionalArguments = "-spec " + Utils::QtcProcess::quoteArg(parsedSpec);
|
||||||
info.additionalArguments.prepend("-spec");
|
|
||||||
}
|
}
|
||||||
|
Utils::QtcProcess::addArgs(&info.additionalArguments, aa);
|
||||||
|
|
||||||
results.append(info);
|
results.append(info);
|
||||||
return results;
|
return results;
|
||||||
|
@@ -87,7 +87,7 @@ public:
|
|||||||
QtVersion *version;
|
QtVersion *version;
|
||||||
bool isTemporary;
|
bool isTemporary;
|
||||||
QtVersion::QmakeBuildConfigs buildConfig;
|
QtVersion::QmakeBuildConfigs buildConfig;
|
||||||
QStringList additionalArguments;
|
QString additionalArguments;
|
||||||
QString directory;
|
QString directory;
|
||||||
bool isExistingBuild;
|
bool isExistingBuild;
|
||||||
bool isShadowBuild;
|
bool isShadowBuild;
|
||||||
|
@@ -106,7 +106,7 @@ struct LauncherPrivate {
|
|||||||
CopyState m_copyState;
|
CopyState m_copyState;
|
||||||
DownloadState m_downloadState;
|
DownloadState m_downloadState;
|
||||||
QString m_fileName;
|
QString m_fileName;
|
||||||
QStringList m_commandLineArgs;
|
QString m_commandLineArgs;
|
||||||
QStringList m_installFileNames;
|
QStringList m_installFileNames;
|
||||||
int m_currentInstallFileName;
|
int m_currentInstallFileName;
|
||||||
int m_verbose;
|
int m_verbose;
|
||||||
@@ -218,7 +218,7 @@ void Launcher::setInstallFileNames(const QStringList &names)
|
|||||||
d->m_currentInstallFileName = 0;
|
d->m_currentInstallFileName = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Launcher::setCommandLineArgs(const QStringList &args)
|
void Launcher::setCommandLineArgs(const QString &args)
|
||||||
{
|
{
|
||||||
d->m_commandLineArgs = args;
|
d->m_commandLineArgs = args;
|
||||||
}
|
}
|
||||||
@@ -267,7 +267,7 @@ bool Launcher::startServer(QString *errorMessage)
|
|||||||
if (!d->m_fileName.isEmpty())
|
if (!d->m_fileName.isEmpty())
|
||||||
str << " Executable=" << d->m_fileName;
|
str << " Executable=" << d->m_fileName;
|
||||||
if (!d->m_commandLineArgs.isEmpty())
|
if (!d->m_commandLineArgs.isEmpty())
|
||||||
str << " Arguments= " << d->m_commandLineArgs.join(QString(QLatin1Char(' ')));
|
str << " Arguments= " << d->m_commandLineArgs;
|
||||||
for (int i = 0; i < d->m_copyState.sourceFileNames.size(); ++i) {
|
for (int i = 0; i < d->m_copyState.sourceFileNames.size(); ++i) {
|
||||||
str << " Package/Source=" << d->m_copyState.sourceFileNames.at(i);
|
str << " Package/Source=" << d->m_copyState.sourceFileNames.at(i);
|
||||||
str << " Remote Package/Destination=" << d->m_copyState.destinationFileNames.at(i);
|
str << " Remote Package/Destination=" << d->m_copyState.destinationFileNames.at(i);
|
||||||
@@ -955,7 +955,7 @@ void Launcher::handleInstallPackageFinished(const TrkResult &result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QByteArray Launcher::startProcessMessage(const QString &executable,
|
QByteArray Launcher::startProcessMessage(const QString &executable,
|
||||||
const QStringList &arguments)
|
const QString &arguments)
|
||||||
{
|
{
|
||||||
// It's not started yet
|
// It's not started yet
|
||||||
QByteArray ba;
|
QByteArray ba;
|
||||||
@@ -965,7 +965,7 @@ QByteArray Launcher::startProcessMessage(const QString &executable,
|
|||||||
QByteArray commandLineBa = executable.toLocal8Bit();
|
QByteArray commandLineBa = executable.toLocal8Bit();
|
||||||
commandLineBa.append(char(0));
|
commandLineBa.append(char(0));
|
||||||
if (!arguments.isEmpty())
|
if (!arguments.isEmpty())
|
||||||
commandLineBa.append(arguments.join(QString(QLatin1Char(' '))).toLocal8Bit());
|
commandLineBa.append(arguments.toLocal8Bit());
|
||||||
appendString(&ba, commandLineBa, TargetByteOrder, true);
|
appendString(&ba, commandLineBa, TargetByteOrder, true);
|
||||||
return ba;
|
return ba;
|
||||||
}
|
}
|
||||||
|
@@ -92,7 +92,7 @@ public:
|
|||||||
void setCopyFileNames(const QStringList &srcName, const QStringList &dstName);
|
void setCopyFileNames(const QStringList &srcName, const QStringList &dstName);
|
||||||
void setDownloadFileName(const QString &srcName, const QString &dstName);
|
void setDownloadFileName(const QString &srcName, const QString &dstName);
|
||||||
void setInstallFileNames(const QStringList &names);
|
void setInstallFileNames(const QStringList &names);
|
||||||
void setCommandLineArgs(const QStringList &args);
|
void setCommandLineArgs(const QString &args);
|
||||||
bool startServer(QString *errorMessage);
|
bool startServer(QString *errorMessage);
|
||||||
void setInstallationMode(InstallationMode installation);
|
void setInstallationMode(InstallationMode installation);
|
||||||
void setInstallationDrive(char drive);
|
void setInstallationDrive(char drive);
|
||||||
@@ -122,7 +122,7 @@ public:
|
|||||||
|
|
||||||
// Create Trk message to start a process.
|
// Create Trk message to start a process.
|
||||||
static QByteArray startProcessMessage(const QString &executable,
|
static QByteArray startProcessMessage(const QString &executable,
|
||||||
const QStringList &arguments);
|
const QString &arguments);
|
||||||
// Create Trk message to read memory
|
// Create Trk message to read memory
|
||||||
static QByteArray readMemoryMessage(uint pid, uint tid, uint from, uint len);
|
static QByteArray readMemoryMessage(uint pid, uint tid, uint from, uint len);
|
||||||
static QByteArray readRegistersMessage(uint pid, uint tid);
|
static QByteArray readRegistersMessage(uint pid, uint tid);
|
||||||
|
Reference in New Issue
Block a user