Merge remote-tracking branch 'origin/2.7' into 2.8

Conflicts:
	src/plugins/qmlprofiler/qmlprofilerengine.cpp

Change-Id: Ic9dc22d2d4a7306cfc4ef0ec158993e3768a9853
This commit is contained in:
Eike Ziller
2013-06-14 16:19:14 +02:00
16 changed files with 106 additions and 23 deletions

View File

@@ -17,7 +17,6 @@
****************************************************************************/ ****************************************************************************/
/*! /*!
\contentspage{index.html}{Qt Creator}
\previouspage qtcreator-ui-text.html \previouspage qtcreator-ui-text.html
\page coding-style.html \page coding-style.html
\nextpage qtcreator-api.html \nextpage qtcreator-api.html

View File

@@ -17,7 +17,6 @@
****************************************************************************/ ****************************************************************************/
/*! /*!
\contentspage{index.html}{Qt Creator}
\page external-tool-spec.html \page external-tool-spec.html
\nextpage coding-style.html \nextpage coding-style.html

View File

@@ -17,7 +17,6 @@
****************************************************************************/ ****************************************************************************/
/*! /*!
\contentspage{index.html}{Extending Qt Creator Manual}
\page qtcreator-api.html \page qtcreator-api.html
\title Qt Creator API Reference \title Qt Creator API Reference

View File

@@ -17,7 +17,7 @@
****************************************************************************/ ****************************************************************************/
/*! /*!
\page index.html \page extending-index.html
\title Extending Qt Creator Manual \title Extending Qt Creator Manual
Qt Creator is a cross-platform integrated development environment (IDE) Qt Creator is a cross-platform integrated development environment (IDE)

View File

@@ -17,7 +17,6 @@
****************************************************************************/ ****************************************************************************/
/*! /*!
\contentspage{index.html}{Qt Creator}
\previouspage external-tool-spec.html \previouspage external-tool-spec.html
\page qtcreator-documentation.html \page qtcreator-documentation.html
\nextpage coding-style.html \nextpage coding-style.html

View File

@@ -17,7 +17,6 @@
****************************************************************************/ ****************************************************************************/
/*! /*!
\contentspage{index.html}{Qt Creator}
\previouspage external-tool-spec.html \previouspage external-tool-spec.html
\page qtcreator-ui-text.html \page qtcreator-ui-text.html
\nextpage coding-style.html \nextpage coding-style.html

View File

@@ -779,6 +779,7 @@ AndroidConfigurations::AndroidConfigurations(QObject *parent)
void AndroidConfigurations::load() void AndroidConfigurations::load()
{ {
bool saveSettings = false;
QSettings *settings = Core::ICore::instance()->settings(); QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(SettingsGroup); settings->beginGroup(SettingsGroup);
m_config = AndroidConfig(*settings); m_config = AndroidConfig(*settings);
@@ -787,11 +788,61 @@ void AndroidConfigurations::load()
Utils::Environment env = Utils::Environment::systemEnvironment(); Utils::Environment env = Utils::Environment::systemEnvironment();
QString location = env.searchInPath(QLatin1String("ant")); QString location = env.searchInPath(QLatin1String("ant"));
QFileInfo fi(location); QFileInfo fi(location);
if (fi.exists() && fi.isExecutable() && !fi.isDir()) if (fi.exists() && fi.isExecutable() && !fi.isDir()) {
m_config.antLocation = Utils::FileName::fromString(location); m_config.antLocation = Utils::FileName::fromString(location);
saveSettings = true;
}
}
if (m_config.openJDKLocation.isEmpty()) {
Utils::Environment env = Utils::Environment::systemEnvironment();
QString location = env.searchInPath(QLatin1String("javac"));
QFileInfo fi(location);
if (fi.exists() && fi.isExecutable() && !fi.isDir()) {
QDir parentDirectory = fi.canonicalPath();
parentDirectory.cdUp(); // one up from bin
m_config.openJDKLocation = Utils::FileName::fromString(parentDirectory.absolutePath());
saveSettings = true;
} else if (Utils::HostOsInfo::isWindowsHost()) {
QSettings settings(QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Javasoft\\Java Development Kit"), QSettings::NativeFormat);
QStringList allVersions = settings.childGroups();
QString javaHome;
int major = -1;
int minor = -1;
foreach (const QString &version, allVersions) {
QStringList parts = version.split(QLatin1String("."));
if (parts.size() != 2) // not interested in 1.7.0_u21
continue;
bool okMajor, okMinor;
int tmpMajor = parts.at(0).toInt(&okMajor);
int tmpMinor = parts.at(1).toInt(&okMinor);
if (!okMajor || !okMinor)
continue;
if (tmpMajor > major
|| (tmpMajor == major
&& tmpMinor > minor)) {
settings.beginGroup(version);
QString tmpJavaHome = settings.value(QLatin1String("JavaHome")).toString();
settings.endGroup();
if (!QFileInfo(tmpJavaHome).exists())
continue;
major = tmpMajor;
minor = tmpMinor;
javaHome = tmpJavaHome;
}
}
if (!javaHome.isEmpty()) {
m_config.openJDKLocation = Utils::FileName::fromString(javaHome);
saveSettings = true;
}
}
} }
settings->endGroup(); settings->endGroup();
if (saveSettings)
save();
} }
void AndroidConfigurations::updateAndroidDevice() void AndroidConfigurations::updateAndroidDevice()

View File

@@ -550,9 +550,14 @@ void AndroidManager::updateTarget(ProjectExplorer::Target *target, const QString
{ {
QString androidDir = dirPath(target).toString(); QString androidDir = dirPath(target).toString();
Utils::Environment env = Utils::Environment::systemEnvironment();
QString javaHome = AndroidConfigurations::instance().config().openJDKLocation.toString();
if (!javaHome.isEmpty())
env.set(QLatin1String("JAVA_HOME"), javaHome);
// clean previous build // clean previous build
QProcess androidProc; QProcess androidProc;
androidProc.setWorkingDirectory(androidDir); androidProc.setWorkingDirectory(androidDir);
androidProc.setProcessEnvironment(env.toProcessEnvironment());
androidProc.start(AndroidConfigurations::instance().antToolPath().toString(), androidProc.start(AndroidConfigurations::instance().antToolPath().toString(),
QStringList() << QLatin1String("clean")); QStringList() << QLatin1String("clean"));
if (!androidProc.waitForFinished(-1)) if (!androidProc.waitForFinished(-1))

View File

@@ -169,6 +169,7 @@ bool AndroidPackageCreationStep::init()
m_certificatePasswdForRun = m_certificatePasswd; m_certificatePasswdForRun = m_certificatePasswd;
m_jarSigner = AndroidConfigurations::instance().jarsignerPath(); m_jarSigner = AndroidConfigurations::instance().jarsignerPath();
m_zipAligner = AndroidConfigurations::instance().zipalignPath(); m_zipAligner = AndroidConfigurations::instance().zipalignPath();
m_environment = bc->environment();
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit()); ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
if (tc->type() != QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE)) if (tc->type() != QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE))
@@ -686,6 +687,7 @@ bool AndroidPackageCreationStep::createPackage()
emit addOutput(tr("Creating package file ..."), MessageOutput); emit addOutput(tr("Creating package file ..."), MessageOutput);
QProcess *const buildProc = new QProcess; QProcess *const buildProc = new QProcess;
buildProc->setProcessEnvironment(m_environment.toProcessEnvironment());
connect(buildProc, SIGNAL(readyReadStandardOutput()), this, connect(buildProc, SIGNAL(readyReadStandardOutput()), this,
SLOT(handleBuildStdOutOutput())); SLOT(handleBuildStdOutOutput()));
@@ -802,6 +804,10 @@ bool AndroidPackageCreationStep::runCommand(QProcess *buildProc
return false; return false;
} }
buildProc->waitForFinished(-1); buildProc->waitForFinished(-1);
handleProcessOutput(buildProc, false);
handleProcessOutput(buildProc, true);
if (buildProc->error() != QProcess::UnknownError if (buildProc->error() != QProcess::UnknownError
|| buildProc->exitCode() != 0) { || buildProc->exitCode() != 0) {
QString mainMessage = tr("Packaging Error: Command '%1 %2' failed.") QString mainMessage = tr("Packaging Error: Command '%1 %2' failed.")
@@ -821,13 +827,7 @@ void AndroidPackageCreationStep::handleBuildStdOutOutput()
QProcess *const process = qobject_cast<QProcess *>(sender()); QProcess *const process = qobject_cast<QProcess *>(sender());
if (!process) if (!process)
return; return;
handleProcessOutput(process, false);
process->setReadChannel(QProcess::StandardOutput);
while (process->canReadLine()) {
QString line = QString::fromLocal8Bit(process->readLine());
m_outputParser.stdOutput(line);
emit addOutput(line, BuildStep::NormalOutput, BuildStep::DontAppendNewline);
}
} }
void AndroidPackageCreationStep::handleBuildStdErrOutput() void AndroidPackageCreationStep::handleBuildStdErrOutput()
@@ -836,11 +836,21 @@ void AndroidPackageCreationStep::handleBuildStdErrOutput()
if (!process) if (!process)
return; return;
process->setReadChannel(QProcess::StandardError); handleProcessOutput(process, true);
}
void AndroidPackageCreationStep::handleProcessOutput(QProcess *process, bool stdErr)
{
process->setReadChannel(stdErr ? QProcess::StandardError : QProcess::StandardOutput);
while (process->canReadLine()) { while (process->canReadLine()) {
QString line = QString::fromLocal8Bit(process->readLine()); QString line = QString::fromLocal8Bit(process->readLine());
m_outputParser.stdError(line); if (stdErr)
emit addOutput(line, BuildStep::ErrorOutput, BuildStep::DontAppendNewline); m_outputParser.stdError(line);
else
m_outputParser.stdOutput(line);
emit addOutput(line, stdErr ? BuildStep::ErrorOutput
: BuildStep::NormalOutput,
BuildStep::DontAppendNewline);
} }
} }

View File

@@ -35,6 +35,7 @@
#include <projectexplorer/abi.h> #include <projectexplorer/abi.h>
#include <projectexplorer/buildstep.h> #include <projectexplorer/buildstep.h>
#include <utils/environment.h>
#include <QAbstractItemModel> #include <QAbstractItemModel>
@@ -113,6 +114,7 @@ private:
static const Core::Id CreatePackageId; static const Core::Id CreatePackageId;
private: private:
void handleProcessOutput(QProcess *process, bool stdErr);
Utils::FileName m_keystorePath; Utils::FileName m_keystorePath;
QString m_keystorePasswd; QString m_keystorePasswd;
QString m_certificateAlias; QString m_certificateAlias;
@@ -139,10 +141,10 @@ private:
QStringList m_qtLibsWithDependencies; QStringList m_qtLibsWithDependencies;
QVector<AndroidManager::Library> m_availableQtLibs; QVector<AndroidManager::Library> m_availableQtLibs;
QStringList m_prebundledLibs; QStringList m_prebundledLibs;
QStringList m_bundledJars; QStringList m_bundledJars;
QStringList m_otherBundledFiles; QStringList m_otherBundledFiles;
bool m_bundleQt; bool m_bundleQt;
Utils::Environment m_environment;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -31,6 +31,11 @@
#include "androidmanager.h" #include "androidmanager.h"
#include <projectexplorer/buildsteplist.h> #include <projectexplorer/buildsteplist.h>
#include <projectexplorer/target.h>
#include <projectexplorer/buildconfiguration.h>
#include <utils/hostosinfo.h>
#include <QDir>
using namespace Android::Internal; using namespace Android::Internal;
@@ -50,6 +55,14 @@ AndroidPackageInstallationStep::AndroidPackageInstallationStep(ProjectExplorer::
bool AndroidPackageInstallationStep::init() bool AndroidPackageInstallationStep::init()
{ {
setUserArguments(QString::fromLatin1("INSTALL_ROOT=\"%1\" install").arg(AndroidManager::dirPath(target()).toUserOutput())); ProjectExplorer::BuildConfiguration *bc = buildConfiguration();
if (!bc)
bc = target()->activeBuildConfiguration();
QString dirPath = AndroidManager::dirPath(target()).toString();
if (Utils::HostOsInfo::isWindowsHost())
if (bc->environment().searchInPath(QLatin1String("sh.exe")).isEmpty())
dirPath = QDir::toNativeSeparators(dirPath);
setUserArguments(QString::fromLatin1("INSTALL_ROOT=\"%1\" install").arg(dirPath));
return MakeStep::init(); return MakeStep::init();
} }

View File

@@ -113,6 +113,9 @@ void AndroidToolChain::addToEnvironment(Environment &env) const
env.set(QLatin1String("ANDROID_NDK_TOOLCHAIN_PREFIX"), AndroidConfigurations::toolchainPrefix(targetAbi().architecture())); env.set(QLatin1String("ANDROID_NDK_TOOLCHAIN_PREFIX"), AndroidConfigurations::toolchainPrefix(targetAbi().architecture()));
env.set(QLatin1String("ANDROID_NDK_TOOLS_PREFIX"), AndroidConfigurations::toolsPrefix(targetAbi().architecture())); env.set(QLatin1String("ANDROID_NDK_TOOLS_PREFIX"), AndroidConfigurations::toolsPrefix(targetAbi().architecture()));
env.set(QLatin1String("ANDROID_NDK_TOOLCHAIN_VERSION"), m_ndkToolChainVersion); env.set(QLatin1String("ANDROID_NDK_TOOLCHAIN_VERSION"), m_ndkToolChainVersion);
QString javaHome = AndroidConfigurations::instance().openJDKPath().toString();
if (!javaHome.isEmpty() && QFileInfo(javaHome).exists())
env.set(QLatin1String("JAVA_HOME"), javaHome);
} }
bool AndroidToolChain::operator ==(const ToolChain &tc) const bool AndroidToolChain::operator ==(const ToolChain &tc) const

View File

@@ -85,7 +85,7 @@ contains(QT_CONFIG, declarative)|!isEmpty(QT.declarative.name) {
} }
} }
} else { } else {
warning("QmlProjectManager, QmlProfiler and QmlDesigner plugins have been disabled: The plugins require QtDeclarative"); warning("QmlProjectManager, QmlProfiler and QmlDesigner plugins have been disabled: The plugins require QtDeclarative")
} }
for(p, SUBDIRS) { for(p, SUBDIRS) {

View File

@@ -41,6 +41,11 @@ LocalQmlProfilerRunner::LocalQmlProfilerRunner(const Configuration &configuratio
this, SIGNAL(appendMessage(QString,Utils::OutputFormat))); this, SIGNAL(appendMessage(QString,Utils::OutputFormat)));
} }
LocalQmlProfilerRunner::~LocalQmlProfilerRunner()
{
disconnect();
}
void LocalQmlProfilerRunner::start() void LocalQmlProfilerRunner::start()
{ {
QString arguments = QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(m_configuration.port); QString arguments = QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(m_configuration.port);

View File

@@ -52,6 +52,7 @@ public:
}; };
explicit LocalQmlProfilerRunner(const Configuration &configuration, QObject *parent = 0); explicit LocalQmlProfilerRunner(const Configuration &configuration, QObject *parent = 0);
~LocalQmlProfilerRunner();
// AbstractQmlProfilerRunner // AbstractQmlProfilerRunner
virtual void start(); virtual void start();

View File

@@ -65,7 +65,7 @@ class QmlProfilerEngine::QmlProfilerEnginePrivate
{ {
public: public:
QmlProfilerEnginePrivate(QmlProfilerEngine *qq, const AnalyzerStartParameters &sp) : q(qq), m_runner(0), sp(sp) {} QmlProfilerEnginePrivate(QmlProfilerEngine *qq, const AnalyzerStartParameters &sp) : q(qq), m_runner(0), sp(sp) {}
~QmlProfilerEnginePrivate() { m_runner->disconnect(); delete m_runner; } ~QmlProfilerEnginePrivate() { delete m_runner; }
bool attach(const QString &address, uint port); bool attach(const QString &address, uint port);
AbstractQmlProfilerRunner *createRunner(ProjectExplorer::RunConfiguration *runConfiguration, AbstractQmlProfilerRunner *createRunner(ProjectExplorer::RunConfiguration *runConfiguration,
@@ -161,7 +161,6 @@ bool QmlProfilerEngine::start()
QTC_ASSERT(d->m_profilerState, return false); QTC_ASSERT(d->m_profilerState, return false);
if (d->m_runner) { if (d->m_runner) {
d->m_runner->disconnect();
delete d->m_runner; delete d->m_runner;
d->m_runner = 0; d->m_runner = 0;
} }
@@ -378,7 +377,6 @@ void QmlProfilerEngine::profilerStateChanged()
// (a new one will be created at start) // (a new one will be created at start)
d->m_noDebugOutputTimer.stop(); d->m_noDebugOutputTimer.stop();
if (d->m_runner) { if (d->m_runner) {
d->m_runner->disconnect();
delete d->m_runner; delete d->m_runner;
d->m_runner = 0; d->m_runner = 0;
} }