forked from qt-creator/qt-creator
android: code cosmetics
Fix whitespace, capitalization, naming, comments, add 'using' in .cpp, remove 'using' in .h, remove unneeded Q_UNUSED, add needed Q_UNUSED, etc. Change-Id: Ibf9ba57850cbea1e79e152ec0165c8b01fa66567 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -54,6 +54,7 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace Android {
|
||||
@@ -94,25 +95,24 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
QLatin1String AndroidConfigurations::toolchainPrefix(ProjectExplorer::Abi::Architecture architecture)
|
||||
QLatin1String AndroidConfigurations::toolchainPrefix(Abi::Architecture architecture)
|
||||
{
|
||||
switch (architecture) {
|
||||
case ProjectExplorer::Abi::ArmArchitecture:
|
||||
case Abi::ArmArchitecture:
|
||||
return ArmToolchainPrefix;
|
||||
case ProjectExplorer::Abi::X86Architecture:
|
||||
case Abi::X86Architecture:
|
||||
return X86ToolchainPrefix;
|
||||
default:
|
||||
return Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QLatin1String AndroidConfigurations::toolsPrefix(ProjectExplorer::Abi::Architecture architecture)
|
||||
QLatin1String AndroidConfigurations::toolsPrefix(Abi::Architecture architecture)
|
||||
{
|
||||
switch (architecture) {
|
||||
case ProjectExplorer::Abi::ArmArchitecture:
|
||||
case Abi::ArmArchitecture:
|
||||
return ArmToolsPrefix;
|
||||
case ProjectExplorer::Abi::X86Architecture:
|
||||
case Abi::X86Architecture:
|
||||
return X86ToolsPrefix;
|
||||
default:
|
||||
return Unknown;
|
||||
@@ -122,16 +122,16 @@ QLatin1String AndroidConfigurations::toolsPrefix(ProjectExplorer::Abi::Architect
|
||||
AndroidConfig::AndroidConfig(const QSettings &settings)
|
||||
{
|
||||
// user settings
|
||||
armGdbLocation = Utils::FileName::fromString(settings.value(ArmGdbLocationKey).toString());
|
||||
armGdbserverLocation = Utils::FileName::fromString(settings.value(ArmGdbserverLocationKey).toString());
|
||||
x86GdbLocation = Utils::FileName::fromString(settings.value(X86GdbLocationKey).toString());
|
||||
x86GdbserverLocation = Utils::FileName::fromString(settings.value(X86GdbserverLocationKey).toString());
|
||||
armGdbLocation = FileName::fromString(settings.value(ArmGdbLocationKey).toString());
|
||||
armGdbserverLocation = FileName::fromString(settings.value(ArmGdbserverLocationKey).toString());
|
||||
x86GdbLocation = FileName::fromString(settings.value(X86GdbLocationKey).toString());
|
||||
x86GdbserverLocation = FileName::fromString(settings.value(X86GdbserverLocationKey).toString());
|
||||
partitionSize = settings.value(PartitionSizeKey, 1024).toInt();
|
||||
sdkLocation = Utils::FileName::fromString(settings.value(SDKLocationKey).toString());
|
||||
ndkLocation = Utils::FileName::fromString(settings.value(NDKLocationKey).toString());
|
||||
antLocation = Utils::FileName::fromString(settings.value(AntLocationKey).toString());
|
||||
openJDKLocation = Utils::FileName::fromString(settings.value(OpenJDKLocationKey).toString());
|
||||
keystoreLocation = Utils::FileName::fromString(settings.value(KeystoreLocationKey).toString());
|
||||
sdkLocation = FileName::fromString(settings.value(SDKLocationKey).toString());
|
||||
ndkLocation = FileName::fromString(settings.value(NDKLocationKey).toString());
|
||||
antLocation = FileName::fromString(settings.value(AntLocationKey).toString());
|
||||
openJDKLocation = FileName::fromString(settings.value(OpenJDKLocationKey).toString());
|
||||
keystoreLocation = FileName::fromString(settings.value(KeystoreLocationKey).toString());
|
||||
|
||||
QRegExp versionRegExp(NDKGccVersionRegExp);
|
||||
const QString &value = settings.value(NDKToolchainVersionKey).toString();
|
||||
@@ -145,11 +145,11 @@ AndroidConfig::AndroidConfig(const QSettings &settings)
|
||||
if (reader.load(settingsFileName())
|
||||
&& settings.value(changeTimeStamp).toInt() != QFileInfo(settingsFileName()).lastModified().toMSecsSinceEpoch() / 1000) {
|
||||
// persisten settings
|
||||
sdkLocation = Utils::FileName::fromString(reader.restoreValue(SDKLocationKey).toString());
|
||||
ndkLocation = Utils::FileName::fromString(reader.restoreValue(NDKLocationKey).toString());
|
||||
antLocation = Utils::FileName::fromString(reader.restoreValue(AntLocationKey).toString());
|
||||
openJDKLocation = Utils::FileName::fromString(reader.restoreValue(OpenJDKLocationKey).toString());
|
||||
keystoreLocation = Utils::FileName::fromString(reader.restoreValue(KeystoreLocationKey).toString());
|
||||
sdkLocation = FileName::fromString(reader.restoreValue(SDKLocationKey).toString());
|
||||
ndkLocation = FileName::fromString(reader.restoreValue(NDKLocationKey).toString());
|
||||
antLocation = FileName::fromString(reader.restoreValue(AntLocationKey).toString());
|
||||
openJDKLocation = FileName::fromString(reader.restoreValue(OpenJDKLocationKey).toString());
|
||||
keystoreLocation = FileName::fromString(reader.restoreValue(KeystoreLocationKey).toString());
|
||||
|
||||
QRegExp versionRegExp(NDKGccVersionRegExp);
|
||||
const QString &value = reader.restoreValue(NDKToolchainVersionKey).toString();
|
||||
@@ -159,16 +159,16 @@ AndroidConfig::AndroidConfig(const QSettings &settings)
|
||||
ndkToolchainVersion = value.mid(versionRegExp.indexIn(value)+1);
|
||||
|
||||
if (armGdbLocation.isEmpty())
|
||||
armGdbLocation = Utils::FileName::fromString(reader.restoreValue(ArmGdbLocationKey).toString());
|
||||
armGdbLocation = FileName::fromString(reader.restoreValue(ArmGdbLocationKey).toString());
|
||||
|
||||
if (armGdbserverLocation.isEmpty())
|
||||
armGdbserverLocation = Utils::FileName::fromString(reader.restoreValue(ArmGdbserverLocationKey).toString());
|
||||
armGdbserverLocation = FileName::fromString(reader.restoreValue(ArmGdbserverLocationKey).toString());
|
||||
|
||||
if (x86GdbLocation.isEmpty())
|
||||
x86GdbLocation = Utils::FileName::fromString(reader.restoreValue(X86GdbLocationKey).toString());
|
||||
x86GdbLocation = FileName::fromString(reader.restoreValue(X86GdbLocationKey).toString());
|
||||
|
||||
if (x86GdbserverLocation.isEmpty())
|
||||
x86GdbserverLocation = Utils::FileName::fromString(reader.restoreValue(X86GdbserverLocationKey).toString());
|
||||
x86GdbserverLocation = FileName::fromString(reader.restoreValue(X86GdbserverLocationKey).toString());
|
||||
// persistent settings
|
||||
}
|
||||
|
||||
@@ -197,8 +197,6 @@ void AndroidConfig::save(QSettings &settings) const
|
||||
settings.setValue(X86GdbLocationKey, x86GdbLocation.toString());
|
||||
settings.setValue(X86GdbserverLocationKey, x86GdbserverLocation.toString());
|
||||
settings.setValue(PartitionSizeKey, partitionSize);
|
||||
// user settings
|
||||
|
||||
}
|
||||
|
||||
void AndroidConfigurations::setConfig(const AndroidConfig &devConfigs)
|
||||
@@ -212,7 +210,7 @@ void AndroidConfigurations::setConfig(const AndroidConfig &devConfigs)
|
||||
void AndroidConfigurations::updateAvailablePlatforms()
|
||||
{
|
||||
m_availablePlatforms.clear();
|
||||
Utils::FileName path = m_config.ndkLocation;
|
||||
FileName path = m_config.ndkLocation;
|
||||
QDirIterator it(path.appendPath(QLatin1String("platforms")).toString(), QStringList() << QLatin1String("android-*"), QDir::Dirs);
|
||||
while (it.hasNext()) {
|
||||
const QString &fileName = it.next();
|
||||
@@ -246,7 +244,7 @@ QStringList AndroidConfigurations::ndkToolchainVersions() const
|
||||
{
|
||||
QRegExp versionRegExp(NDKGccVersionRegExp);
|
||||
QStringList result;
|
||||
Utils::FileName path = m_config.ndkLocation;
|
||||
FileName path = m_config.ndkLocation;
|
||||
QDirIterator it(path.appendPath(QLatin1String("toolchains")).toString(),
|
||||
QStringList() << QLatin1String("*"), QDir::Dirs);
|
||||
while (it.hasNext()) {
|
||||
@@ -261,46 +259,46 @@ QStringList AndroidConfigurations::ndkToolchainVersions() const
|
||||
return result;
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::adbToolPath() const
|
||||
FileName AndroidConfigurations::adbToolPath() const
|
||||
{
|
||||
Utils::FileName path = m_config.sdkLocation;
|
||||
FileName path = m_config.sdkLocation;
|
||||
return path.appendPath(QLatin1String("platform-tools/adb" ANDROID_EXE_SUFFIX));
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::androidToolPath() const
|
||||
FileName AndroidConfigurations::androidToolPath() const
|
||||
{
|
||||
#ifdef Q_OS_WIN32
|
||||
// I want to switch from using android.bat to using an executable. All it really does is call
|
||||
// Java and I've made some progress on it. So if android.exe exists, return that instead.
|
||||
Utils::FileName path = m_config.sdkLocation;
|
||||
FileName path = m_config.sdkLocation;
|
||||
path.appendPath(QLatin1String("tools/android"ANDROID_EXE_SUFFIX));
|
||||
if (path.toFileInfo().exists())
|
||||
return path;
|
||||
path = m_config.sdkLocation;
|
||||
return path.appendPath(QLatin1String("tools/android"ANDROID_BAT_SUFFIX));
|
||||
#else
|
||||
Utils::FileName path = m_config.sdkLocation;
|
||||
FileName path = m_config.sdkLocation;
|
||||
return path.appendPath(QLatin1String("tools/android"));
|
||||
#endif
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::antToolPath() const
|
||||
FileName AndroidConfigurations::antToolPath() const
|
||||
{
|
||||
if (!m_config.antLocation.isEmpty())
|
||||
return m_config.antLocation;
|
||||
else
|
||||
return Utils::FileName::fromString(QLatin1String("ant"));
|
||||
return FileName::fromString(QLatin1String("ant"));
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::emulatorToolPath() const
|
||||
FileName AndroidConfigurations::emulatorToolPath() const
|
||||
{
|
||||
Utils::FileName path = m_config.sdkLocation;
|
||||
FileName path = m_config.sdkLocation;
|
||||
return path.appendPath(QLatin1String("tools/emulator" ANDROID_EXE_SUFFIX));
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::toolPath(ProjectExplorer::Abi::Architecture architecture) const
|
||||
FileName AndroidConfigurations::toolPath(Abi::Architecture architecture) const
|
||||
{
|
||||
Utils::FileName path = m_config.ndkLocation;
|
||||
FileName path = m_config.ndkLocation;
|
||||
return path.appendPath(QString::fromLatin1("toolchains/%1-%2/prebuilt/%3/bin/%4")
|
||||
.arg(toolchainPrefix(architecture))
|
||||
.arg(m_config.ndkToolchainVersion)
|
||||
@@ -308,56 +306,56 @@ Utils::FileName AndroidConfigurations::toolPath(ProjectExplorer::Abi::Architectu
|
||||
.arg(toolsPrefix(architecture)));
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::stripPath(ProjectExplorer::Abi::Architecture architecture) const
|
||||
FileName AndroidConfigurations::stripPath(Abi::Architecture architecture) const
|
||||
{
|
||||
return toolPath(architecture).append(QLatin1String("-strip" ANDROID_EXE_SUFFIX));
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::readelfPath(ProjectExplorer::Abi::Architecture architecture) const
|
||||
FileName AndroidConfigurations::readelfPath(Abi::Architecture architecture) const
|
||||
{
|
||||
return toolPath(architecture).append(QLatin1String("-readelf" ANDROID_EXE_SUFFIX));
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::gccPath(ProjectExplorer::Abi::Architecture architecture) const
|
||||
FileName AndroidConfigurations::gccPath(Abi::Architecture architecture) const
|
||||
{
|
||||
return toolPath(architecture).append(QLatin1String("-gcc" ANDROID_EXE_SUFFIX));
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::gdbServerPath(ProjectExplorer::Abi::Architecture architecture) const
|
||||
FileName AndroidConfigurations::gdbServerPath(Abi::Architecture architecture) const
|
||||
{
|
||||
Utils::FileName gdbServerPath;
|
||||
FileName gdbServerPath;
|
||||
switch (architecture) {
|
||||
case ProjectExplorer::Abi::ArmArchitecture:
|
||||
case Abi::ArmArchitecture:
|
||||
gdbServerPath = m_config.armGdbserverLocation;
|
||||
break;
|
||||
case ProjectExplorer::Abi::X86Architecture:
|
||||
case Abi::X86Architecture:
|
||||
gdbServerPath = m_config.x86GdbserverLocation;
|
||||
break;
|
||||
default:
|
||||
gdbServerPath = Utils::FileName::fromString(Unknown);
|
||||
gdbServerPath = FileName::fromString(Unknown);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!gdbServerPath.isEmpty())
|
||||
return gdbServerPath;
|
||||
Utils::FileName path = m_config.ndkLocation;
|
||||
FileName path = m_config.ndkLocation;
|
||||
return path.appendPath(QString::fromLatin1("toolchains/%1-%2/prebuilt/gdbserver")
|
||||
.arg(toolchainPrefix(architecture))
|
||||
.arg(m_config.ndkToolchainVersion));
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::gdbPath(ProjectExplorer::Abi::Architecture architecture) const
|
||||
FileName AndroidConfigurations::gdbPath(Abi::Architecture architecture) const
|
||||
{
|
||||
Utils::FileName gdbPath;
|
||||
FileName gdbPath;
|
||||
switch (architecture) {
|
||||
case ProjectExplorer::Abi::ArmArchitecture:
|
||||
case Abi::ArmArchitecture:
|
||||
gdbPath = m_config.armGdbLocation;
|
||||
break;
|
||||
case ProjectExplorer::Abi::X86Architecture:
|
||||
case Abi::X86Architecture:
|
||||
gdbPath = m_config.x86GdbLocation;
|
||||
break;
|
||||
default:
|
||||
gdbPath = Utils::FileName::fromString(Unknown);
|
||||
gdbPath = FileName::fromString(Unknown);
|
||||
break;
|
||||
}
|
||||
if (!gdbPath.isEmpty())
|
||||
@@ -365,30 +363,30 @@ Utils::FileName AndroidConfigurations::gdbPath(ProjectExplorer::Abi::Architectur
|
||||
return toolPath(architecture).append(QLatin1String("-gdb" ANDROID_EXE_SUFFIX));
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::openJDKPath() const
|
||||
FileName AndroidConfigurations::openJDKPath() const
|
||||
{
|
||||
return m_config.openJDKLocation;
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::openJDKBinPath() const
|
||||
FileName AndroidConfigurations::openJDKBinPath() const
|
||||
{
|
||||
Utils::FileName path = m_config.openJDKLocation;
|
||||
FileName path = m_config.openJDKLocation;
|
||||
if (!path.isEmpty())
|
||||
return path.appendPath(QLatin1String("bin"));
|
||||
return path;
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::keytoolPath() const
|
||||
FileName AndroidConfigurations::keytoolPath() const
|
||||
{
|
||||
return openJDKBinPath().appendPath(keytoolName);
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::jarsignerPath() const
|
||||
FileName AndroidConfigurations::jarsignerPath() const
|
||||
{
|
||||
return openJDKBinPath().appendPath(jarsignerName);
|
||||
}
|
||||
|
||||
Utils::FileName AndroidConfigurations::zipalignPath() const
|
||||
FileName AndroidConfigurations::zipalignPath() const
|
||||
{
|
||||
Utils::FileName path = m_config.sdkLocation;
|
||||
return path.appendPath(QLatin1String("tools/zipalign" ANDROID_EXE_SUFFIX));
|
||||
|
||||
@@ -78,7 +78,8 @@ public:
|
||||
unsigned partitionSize;
|
||||
};
|
||||
|
||||
struct AndroidDeviceInfo {
|
||||
struct AndroidDeviceInfo
|
||||
{
|
||||
QString serialNumber;
|
||||
QString cpuABI;
|
||||
int sdk;
|
||||
@@ -87,9 +88,8 @@ struct AndroidDeviceInfo {
|
||||
class AndroidConfigurations : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(AndroidConfigurations)
|
||||
public:
|
||||
|
||||
public:
|
||||
static AndroidConfigurations &instance(QObject *parent = 0);
|
||||
AndroidConfig config() const { return m_config; }
|
||||
void setConfig(const AndroidConfig &config);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#ifndef ANDROIDCONSTANTS_H
|
||||
#define ANDROIDCONSTANTS_H
|
||||
|
||||
#include <QLatin1String>
|
||||
#include <QtGlobal>
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
@@ -44,8 +44,6 @@ enum AndroidQemuStatus {
|
||||
AndroidQemuUserReason
|
||||
};
|
||||
|
||||
#define ANDROID_PREFIX "Qt4ProjectManager.AndroidRunConfiguration"
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
#define ANDROID_EXE_SUFFIX ".exe"
|
||||
#define ANDROID_BAT_SUFFIX ".bat"
|
||||
@@ -54,8 +52,6 @@ enum AndroidQemuStatus {
|
||||
#define ANDROID_BAT_SUFFIX ""
|
||||
#endif
|
||||
|
||||
static const QLatin1String ANDROID_RC_ID_PREFIX(ANDROID_PREFIX ":");
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
namespace Constants {
|
||||
@@ -68,8 +64,7 @@ const char ANDROIDQT[] = "Qt4ProjectManager.QtVersion.Android";
|
||||
|
||||
const char ANDROID_DEVICE_TYPE[] = "Android.Device.Type";
|
||||
const char ANDROID_DEVICE_ID[] = "Android Device";
|
||||
|
||||
}
|
||||
} // namespace Constants;
|
||||
} // namespace Android
|
||||
|
||||
#endif // ANDROIDCONSTANTS_H
|
||||
|
||||
@@ -41,6 +41,7 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
class AndroidCreateKeystoreCertificate : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -191,4 +191,4 @@ QStringList AndroidDebugSupport::qtSoPaths(QtSupport::BaseQtVersion *qtVersion)
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Qt4ProjectManager
|
||||
} // namespace Android
|
||||
|
||||
@@ -34,16 +34,12 @@
|
||||
#include "androidrunconfiguration.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
|
||||
namespace Debugger {
|
||||
class DebuggerRunControl;
|
||||
}
|
||||
namespace Debugger { class DebuggerRunControl; }
|
||||
namespace QtSupport {class BaseQtVersion; }
|
||||
namespace ProjectExplorer { class RunControl; }
|
||||
|
||||
namespace Android {
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class AndroidRunConfiguration;
|
||||
@@ -52,6 +48,7 @@ class AndroidRunner;
|
||||
class AndroidDebugSupport : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static ProjectExplorer::RunControl *createDebugRunControl(AndroidRunConfiguration *runConfig);
|
||||
|
||||
|
||||
@@ -42,40 +42,36 @@
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
|
||||
using namespace Android::Internal;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
AndroidDeployConfiguration::AndroidDeployConfiguration(ProjectExplorer::Target *parent, Core::Id id)
|
||||
:DeployConfiguration(parent, id)
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
AndroidDeployConfiguration::AndroidDeployConfiguration(Target *parent, Core::Id id)
|
||||
: DeployConfiguration(parent, id)
|
||||
{
|
||||
setDisplayName(tr("Deploy to Android device"));
|
||||
setDefaultDisplayName(displayName());
|
||||
}
|
||||
|
||||
AndroidDeployConfiguration::~AndroidDeployConfiguration()
|
||||
AndroidDeployConfiguration::AndroidDeployConfiguration(Target *parent, DeployConfiguration *source)
|
||||
: DeployConfiguration(parent, source)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AndroidDeployConfiguration::AndroidDeployConfiguration(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source)
|
||||
:DeployConfiguration(parent, source)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AndroidDeployConfigurationFactory::AndroidDeployConfigurationFactory(QObject *parent) :
|
||||
ProjectExplorer::DeployConfigurationFactory(parent)
|
||||
AndroidDeployConfigurationFactory::AndroidDeployConfigurationFactory(QObject *parent)
|
||||
: DeployConfigurationFactory(parent)
|
||||
{
|
||||
setObjectName(QLatin1String("AndroidDeployConfigurationFactory"));
|
||||
}
|
||||
|
||||
bool AndroidDeployConfigurationFactory::canCreate(ProjectExplorer::Target *parent, const Core::Id id) const
|
||||
bool AndroidDeployConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
|
||||
{
|
||||
return availableCreationIds(parent).contains(id);
|
||||
}
|
||||
|
||||
ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::create(ProjectExplorer::Target *parent, const Core::Id id)
|
||||
DeployConfiguration *AndroidDeployConfigurationFactory::create(Target *parent, const Core::Id id)
|
||||
{
|
||||
Q_UNUSED(id);
|
||||
AndroidDeployConfiguration *dc = new AndroidDeployConfiguration(parent, id);
|
||||
if (!dc)
|
||||
return 0;
|
||||
@@ -85,17 +81,17 @@ ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::create(
|
||||
return dc;
|
||||
}
|
||||
|
||||
bool AndroidDeployConfigurationFactory::canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const
|
||||
bool AndroidDeployConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const
|
||||
{
|
||||
return canCreate(parent, ProjectExplorer::idFromMap(map));
|
||||
return canCreate(parent, idFromMap(map));
|
||||
}
|
||||
|
||||
ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map)
|
||||
DeployConfiguration *AndroidDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map)
|
||||
{
|
||||
if (!canRestore(parent, map))
|
||||
return 0;
|
||||
|
||||
AndroidDeployConfiguration *dc = new AndroidDeployConfiguration(parent, ProjectExplorer::idFromMap(map));
|
||||
AndroidDeployConfiguration *dc = new AndroidDeployConfiguration(parent, idFromMap(map));
|
||||
if (dc->fromMap(map))
|
||||
return dc;
|
||||
|
||||
@@ -103,21 +99,21 @@ ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::restore
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool AndroidDeployConfigurationFactory::canClone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) const
|
||||
bool AndroidDeployConfigurationFactory::canClone(Target *parent, DeployConfiguration *source) const
|
||||
{
|
||||
if (!AndroidManager::supportsAndroid(parent))
|
||||
return false;
|
||||
return source->id() == ANDROID_DEPLOYCONFIGURATION_ID;
|
||||
}
|
||||
|
||||
ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source)
|
||||
DeployConfiguration *AndroidDeployConfigurationFactory::clone(Target *parent, DeployConfiguration *source)
|
||||
{
|
||||
if (!canClone(parent, source))
|
||||
return 0;
|
||||
return new AndroidDeployConfiguration(parent, source);
|
||||
}
|
||||
|
||||
QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const
|
||||
QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(Target *parent) const
|
||||
{
|
||||
QList<Core::Id> ids;
|
||||
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
|
||||
@@ -126,10 +122,9 @@ QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(ProjectE
|
||||
if (!parent->project()->supportsProfile(parent->profile()))
|
||||
return ids;
|
||||
|
||||
ProjectExplorer::ToolChain *tc
|
||||
= ProjectExplorer::ToolChainProfileInformation::toolChain(parent->profile());
|
||||
ToolChain *tc = ToolChainProfileInformation::toolChain(parent->profile());
|
||||
|
||||
if (!tc || tc->targetAbi().osFlavor() != ProjectExplorer::Abi::AndroidLinuxFlavor)
|
||||
if (!tc || tc->targetAbi().osFlavor() != Abi::AndroidLinuxFlavor)
|
||||
return ids;
|
||||
|
||||
if (QtSupport::QtProfileInformation::qtVersion(parent->profile())->type() != QLatin1String(Constants::ANDROIDQT))
|
||||
@@ -141,12 +136,15 @@ QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(ProjectE
|
||||
|
||||
QString AndroidDeployConfigurationFactory::displayNameForId(const Core::Id id) const
|
||||
{
|
||||
if (id.toString().startsWith(QLatin1String(ANDROID_DC_PREFIX)))
|
||||
if (id.name().startsWith(ANDROID_DC_PREFIX))
|
||||
return tr("Deploy on Android");
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool AndroidDeployConfigurationFactory::canHandle(ProjectExplorer::Target *parent) const
|
||||
bool AndroidDeployConfigurationFactory::canHandle(Target *parent) const
|
||||
{
|
||||
return AndroidManager::supportsAndroid(parent);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Android
|
||||
|
||||
@@ -28,15 +28,14 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef QT4PROJECTMANAGER_QT4ANDROIDDEPLOYCONFIGURATION_H
|
||||
#define QT4PROJECTMANAGER_QT4ANDROIDDEPLOYCONFIGURATION_H
|
||||
#ifndef ANDROIDDEPLOYCONFIGURATION_H
|
||||
#define ANDROIDDEPLOYCONFIGURATION_H
|
||||
|
||||
#include <projectexplorer/deployconfiguration.h>
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
class Target;
|
||||
const char ANDROID_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.AndroidDeployConfiguration";
|
||||
const char ANDROID_DC_PREFIX[] = "Qt4ProjectManager.AndroidDeployConfiguration.";
|
||||
|
||||
@@ -47,7 +46,7 @@ class AndroidDeployConfiguration : public ProjectExplorer::DeployConfiguration
|
||||
|
||||
public:
|
||||
AndroidDeployConfiguration(ProjectExplorer::Target *parent, Core::Id id);
|
||||
virtual ~AndroidDeployConfiguration();
|
||||
|
||||
protected:
|
||||
AndroidDeployConfiguration(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source);
|
||||
|
||||
@@ -78,4 +77,4 @@ private:
|
||||
} // namespace Internal
|
||||
} // namespace Android
|
||||
|
||||
#endif // QT4PROJECTMANAGER_QT4ANDROIDDEPLOYCONFIGURATION_H
|
||||
#endif // ANDROIDDEPLOYCONFIGURATION_H
|
||||
|
||||
@@ -77,6 +77,7 @@ bool AndroidDeployStepFactory::canCreate(BuildStepList *parent, const Core::Id i
|
||||
BuildStep *AndroidDeployStepFactory::create(BuildStepList *parent, const Core::Id id)
|
||||
{
|
||||
Q_ASSERT(canCreate(parent, id));
|
||||
Q_UNUSED(id);
|
||||
return new AndroidDeployStep(parent);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,9 +34,7 @@
|
||||
#include <projectexplorer/buildstep.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class AndroidDeployStepWidget;
|
||||
}
|
||||
namespace Ui { class AndroidDeployStepWidget; }
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Android {
|
||||
|
||||
@@ -49,7 +49,7 @@ AndroidDevice::AndroidDevice()
|
||||
}
|
||||
|
||||
AndroidDevice::AndroidDevice(const AndroidDevice &other)
|
||||
: ProjectExplorer::IDevice(other)
|
||||
: IDevice(other)
|
||||
{ }
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "androiddevice.h"
|
||||
|
||||
#include "androidconstants.h"
|
||||
#include <coreplugin/id.h>
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
@@ -39,10 +39,6 @@
|
||||
#define ASSERT_STATE_GENERIC(State, expected, actual) \
|
||||
AndroidGlobal::assertState<State>(expected, actual, Q_FUNC_INFO)
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QString;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
|
||||
@@ -40,8 +40,6 @@
|
||||
namespace ProjectExplorer { class Target; }
|
||||
|
||||
namespace Android {
|
||||
class AndroidPlugin;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class AndroidManager : public QObject
|
||||
|
||||
@@ -36,26 +36,20 @@
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
using ProjectExplorer::BuildStepList;
|
||||
using ProjectExplorer::BuildStep;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
AndroidPackageCreationFactory::AndroidPackageCreationFactory(QObject *parent)
|
||||
: ProjectExplorer::IBuildStepFactory(parent)
|
||||
: IBuildStepFactory(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QList<Core::Id> AndroidPackageCreationFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
|
||||
QList<Core::Id> AndroidPackageCreationFactory::availableCreationIds(BuildStepList *parent) const
|
||||
{
|
||||
if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
|
||||
if (parent->id() != Constants::BUILDSTEPS_DEPLOY)
|
||||
return QList<Core::Id>();
|
||||
if (!AndroidManager::supportsAndroid(parent->target()))
|
||||
return QList<Core::Id>();
|
||||
@@ -71,29 +65,27 @@ QString AndroidPackageCreationFactory::displayNameForId(const Core::Id id) const
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool AndroidPackageCreationFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
|
||||
bool AndroidPackageCreationFactory::canCreate(BuildStepList *parent, const Core::Id id) const
|
||||
{
|
||||
return availableCreationIds(parent).contains(id);
|
||||
}
|
||||
|
||||
BuildStep *AndroidPackageCreationFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)
|
||||
BuildStep *AndroidPackageCreationFactory::create(BuildStepList *parent, const Core::Id id)
|
||||
{
|
||||
Q_ASSERT(canCreate(parent, id));
|
||||
Q_UNUSED(id);
|
||||
return new AndroidPackageCreationStep(parent);
|
||||
}
|
||||
|
||||
bool AndroidPackageCreationFactory::canRestore(ProjectExplorer::BuildStepList *parent,
|
||||
const QVariantMap &map) const
|
||||
bool AndroidPackageCreationFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const
|
||||
{
|
||||
return canCreate(parent, ProjectExplorer::idFromMap(map));
|
||||
return canCreate(parent, idFromMap(map));
|
||||
}
|
||||
|
||||
BuildStep *AndroidPackageCreationFactory::restore(ProjectExplorer::BuildStepList *parent,
|
||||
const QVariantMap &map)
|
||||
BuildStep *AndroidPackageCreationFactory::restore(BuildStepList *parent, const QVariantMap &map)
|
||||
{
|
||||
Q_ASSERT(canRestore(parent, map));
|
||||
AndroidPackageCreationStep *const step
|
||||
= new AndroidPackageCreationStep(parent);
|
||||
AndroidPackageCreationStep *const step = new AndroidPackageCreationStep(parent);
|
||||
if (!step->fromMap(map)) {
|
||||
delete step;
|
||||
return 0;
|
||||
@@ -101,14 +93,12 @@ BuildStep *AndroidPackageCreationFactory::restore(ProjectExplorer::BuildStepList
|
||||
return step;
|
||||
}
|
||||
|
||||
bool AndroidPackageCreationFactory::canClone(ProjectExplorer::BuildStepList *parent,
|
||||
ProjectExplorer::BuildStep *product) const
|
||||
bool AndroidPackageCreationFactory::canClone(BuildStepList *parent, BuildStep *product) const
|
||||
{
|
||||
return canCreate(parent, product->id());
|
||||
}
|
||||
|
||||
BuildStep *AndroidPackageCreationFactory::clone(ProjectExplorer::BuildStepList *parent,
|
||||
ProjectExplorer::BuildStep *product)
|
||||
BuildStep *AndroidPackageCreationFactory::clone(BuildStepList *parent, BuildStep *product)
|
||||
{
|
||||
Q_ASSERT(canClone(parent, product));
|
||||
return new AndroidPackageCreationStep(parent, static_cast<AndroidPackageCreationStep *>(product));
|
||||
|
||||
@@ -58,9 +58,6 @@
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace ProjectExplorer::Constants;
|
||||
using ProjectExplorer::BuildStepList;
|
||||
using ProjectExplorer::BuildStepConfigWidget;
|
||||
using ProjectExplorer::Task;
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
@@ -127,10 +124,6 @@ AndroidPackageCreationStep::AndroidPackageCreationStep(BuildStepList *bsl,
|
||||
ctor();
|
||||
}
|
||||
|
||||
AndroidPackageCreationStep::~AndroidPackageCreationStep()
|
||||
{
|
||||
}
|
||||
|
||||
void AndroidPackageCreationStep::ctor()
|
||||
{
|
||||
setDefaultDisplayName(tr("Packaging for Android"));
|
||||
|
||||
@@ -31,14 +31,14 @@
|
||||
#ifndef ANDROIDPACKAGECREATIONSTEP_H
|
||||
#define ANDROIDPACKAGECREATIONSTEP_H
|
||||
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/buildstep.h>
|
||||
#include <QAbstractItemModel>
|
||||
#include "javaparser.h"
|
||||
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/buildstep.h>
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QDateTime;
|
||||
class QFile;
|
||||
class QProcess;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
@@ -53,12 +53,11 @@ class AndroidPackageCreationStep : public ProjectExplorer::BuildStep
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class AndroidPackageCreationFactory;
|
||||
|
||||
public:
|
||||
AndroidPackageCreationStep(ProjectExplorer::BuildStepList *bsl);
|
||||
~AndroidPackageCreationStep();
|
||||
|
||||
static bool removeDirectory(const QString &dirPath);
|
||||
|
||||
static void stripAndroidLibs(const QStringList &files, ProjectExplorer::Abi::Architecture architecture);
|
||||
|
||||
static const QLatin1String DefaultVersionNumber;
|
||||
@@ -76,8 +75,8 @@ public:
|
||||
QAbstractItemModel *keystoreCertificates();
|
||||
|
||||
protected:
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
virtual QVariantMap toMap() const;
|
||||
bool fromMap(const QVariantMap &map);
|
||||
QVariantMap toMap() const;
|
||||
|
||||
private slots:
|
||||
void handleBuildStdOutOutput();
|
||||
@@ -88,6 +87,9 @@ private slots:
|
||||
void setQtLibs(const QStringList &qtLibs);
|
||||
void setPrebundledLibs(const QStringList &prebundledLibs);
|
||||
|
||||
signals:
|
||||
void updateRequiredLibrariesModels();
|
||||
|
||||
private:
|
||||
AndroidPackageCreationStep(ProjectExplorer::BuildStepList *buildConfig,
|
||||
AndroidPackageCreationStep *other);
|
||||
@@ -130,8 +132,6 @@ private:
|
||||
QStringList m_qtLibs;
|
||||
QStringList m_availableQtLibs;
|
||||
QStringList m_prebundledLibs;
|
||||
signals:
|
||||
void updateRequiredLibrariesModels();
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -63,9 +63,10 @@ bool checkPackageName(const QString &packageName)
|
||||
}
|
||||
|
||||
///////////////////////////// CheckModel /////////////////////////////
|
||||
CheckModel::CheckModel(QObject *parent) : QAbstractListModel(parent)
|
||||
{
|
||||
|
||||
CheckModel::CheckModel(QObject *parent)
|
||||
: QAbstractListModel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void CheckModel::setAvailableItems(const QStringList &items)
|
||||
@@ -136,11 +137,12 @@ Qt::ItemFlags CheckModel::flags(const QModelIndex &/*index*/) const
|
||||
{
|
||||
return Qt::ItemIsSelectable|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled;
|
||||
}
|
||||
///////////////////////////// CheckModel /////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////// PermissionsModel /////////////////////////////
|
||||
PermissionsModel::PermissionsModel(QObject *parent):QAbstractListModel(parent)
|
||||
|
||||
PermissionsModel::PermissionsModel(QObject *parent)
|
||||
: QAbstractListModel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -149,6 +151,7 @@ void PermissionsModel::setPermissions(const QStringList &permissions)
|
||||
m_permissions = permissions;
|
||||
reset();
|
||||
}
|
||||
|
||||
const QStringList &PermissionsModel::permissions()
|
||||
{
|
||||
return m_permissions;
|
||||
@@ -195,10 +198,10 @@ int PermissionsModel::rowCount(const QModelIndex &parent) const
|
||||
Q_UNUSED(parent)
|
||||
return m_permissions.count();
|
||||
}
|
||||
///////////////////////////// PermissionsModel /////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////// AndroidPackageCreationWidget /////////////////////////////
|
||||
|
||||
AndroidPackageCreationWidget::AndroidPackageCreationWidget(AndroidPackageCreationStep *step)
|
||||
: ProjectExplorer::BuildStepConfigWidget(),
|
||||
m_step(step),
|
||||
@@ -215,7 +218,6 @@ AndroidPackageCreationWidget::AndroidPackageCreationWidget(AndroidPackageCreatio
|
||||
connect(m_step, SIGNAL(updateRequiredLibrariesModels()), SLOT(updateRequiredLibrariesModels()));
|
||||
}
|
||||
|
||||
|
||||
void AndroidPackageCreationWidget::initGui()
|
||||
{
|
||||
updateAndroidProjectInfo();
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#define ANDROIDPACKAGECREATIONWIDGET_H
|
||||
|
||||
#include <projectexplorer/buildstep.h>
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <QStringList>
|
||||
|
||||
|
||||
@@ -39,8 +39,6 @@
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace Android {
|
||||
@@ -77,6 +75,7 @@ bool AndroidPackageInstallationFactory::canCreate(BuildStepList *parent, const C
|
||||
BuildStep *AndroidPackageInstallationFactory::create(BuildStepList *parent, const Core::Id id)
|
||||
{
|
||||
Q_ASSERT(canCreate(parent, id));
|
||||
Q_UNUSED(id);
|
||||
return new AndroidPackageInstallationStep(parent);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#ifndef ANDROIDPACKAGEINSTALLATIONFACTORY_H
|
||||
#define ANDROIDPACKAGEINSTALLATIONFACTORY_H
|
||||
|
||||
#include <projectexplorer/buildstep.h>
|
||||
|
||||
namespace Android {
|
||||
|
||||
@@ -31,30 +31,22 @@
|
||||
#include "androidpackageinstallationstep.h"
|
||||
#include "androidmanager.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
|
||||
using namespace Android::Internal;
|
||||
|
||||
const Core::Id AndroidPackageInstallationStep::Id("Qt4ProjectManager.AndroidPackageInstallationStep");
|
||||
const Core::Id AndroidPackageInstallationStep::Id = Core::Id("Qt4ProjectManager.AndroidPackageInstallationStep");
|
||||
|
||||
static inline QString stepDisplayName()
|
||||
AndroidPackageInstallationStep::AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bsl)
|
||||
: MakeStep(bsl, Id)
|
||||
{
|
||||
return AndroidPackageInstallationStep::tr("Copy application data");
|
||||
}
|
||||
|
||||
AndroidPackageInstallationStep::AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bsl) : MakeStep(bsl, Id)
|
||||
{
|
||||
const QString name = stepDisplayName();
|
||||
const QString name = tr("Copy application data");
|
||||
setDefaultDisplayName(name);
|
||||
setDisplayName(name);
|
||||
}
|
||||
|
||||
AndroidPackageInstallationStep::AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bc, AndroidPackageInstallationStep *other): MakeStep(bc, other)
|
||||
{ }
|
||||
|
||||
AndroidPackageInstallationStep::~AndroidPackageInstallationStep()
|
||||
AndroidPackageInstallationStep::AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bc, AndroidPackageInstallationStep *other)
|
||||
: MakeStep(bc, other)
|
||||
{ }
|
||||
|
||||
bool AndroidPackageInstallationStep::init()
|
||||
|
||||
@@ -40,15 +40,14 @@ class AndroidPackageInstallationStep : public Qt4ProjectManager::MakeStep
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class AndroidPackageInstallationFactory;
|
||||
|
||||
public:
|
||||
explicit AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bsl);
|
||||
virtual ~AndroidPackageInstallationStep();
|
||||
virtual bool init();
|
||||
bool init();
|
||||
|
||||
private:
|
||||
AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bc,
|
||||
AndroidPackageInstallationStep *other);
|
||||
|
||||
private:
|
||||
static const Core::Id Id;
|
||||
};
|
||||
|
||||
|
||||
@@ -54,14 +54,10 @@ namespace Android {
|
||||
AndroidPlugin::AndroidPlugin()
|
||||
{ }
|
||||
|
||||
AndroidPlugin::~AndroidPlugin()
|
||||
{ }
|
||||
|
||||
bool AndroidPlugin::initialize(const QStringList &arguments,
|
||||
QString *error_message)
|
||||
bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
{
|
||||
Q_UNUSED(arguments);
|
||||
Q_UNUSED(error_message);
|
||||
Q_UNUSED(errorMessage);
|
||||
|
||||
Internal::AndroidConfigurations::instance(this);
|
||||
|
||||
|
||||
@@ -41,9 +41,8 @@ class AndroidPlugin : public ExtensionSystem::IPlugin
|
||||
|
||||
public:
|
||||
AndroidPlugin();
|
||||
~AndroidPlugin();
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *error_message);
|
||||
bool initialize(const QStringList &arguments, QString *errorMessage);
|
||||
void extensionsInitialized();
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ using namespace Android::Internal;
|
||||
AndroidQtVersion::AndroidQtVersion()
|
||||
: QtSupport::BaseQtVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AndroidQtVersion::AndroidQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
|
||||
@@ -47,11 +46,6 @@ AndroidQtVersion::AndroidQtVersion(const Utils::FileName &path, bool isAutodetec
|
||||
{
|
||||
}
|
||||
|
||||
AndroidQtVersion::~AndroidQtVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AndroidQtVersion *AndroidQtVersion::clone() const
|
||||
{
|
||||
return new AndroidQtVersion(*this);
|
||||
|
||||
@@ -41,14 +41,13 @@ namespace Internal {
|
||||
class AndroidQtVersion : public QtSupport::BaseQtVersion
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidQtVersion)
|
||||
|
||||
public:
|
||||
AndroidQtVersion();
|
||||
AndroidQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
|
||||
~AndroidQtVersion ();
|
||||
|
||||
AndroidQtVersion *clone() const;
|
||||
|
||||
QString type() const;
|
||||
|
||||
bool isValid() const;
|
||||
QString invalidReason() const;
|
||||
|
||||
|
||||
@@ -43,12 +43,6 @@ namespace Internal {
|
||||
AndroidQtVersionFactory::AndroidQtVersionFactory(QObject *parent)
|
||||
: QtSupport::QtVersionFactory(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AndroidQtVersionFactory::~AndroidQtVersionFactory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool AndroidQtVersionFactory::canRestore(const QString &type)
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#ifndef ANDROIDQTVERSIONFACTORY_H
|
||||
#define ANDROIDQTVERSIONFACTORY_H
|
||||
|
||||
#include <qtsupport/qtversionfactory.h>
|
||||
|
||||
namespace Android {
|
||||
@@ -39,14 +40,13 @@ class AndroidQtVersionFactory : public QtSupport::QtVersionFactory
|
||||
{
|
||||
public:
|
||||
explicit AndroidQtVersionFactory(QObject *parent = 0);
|
||||
~AndroidQtVersionFactory();
|
||||
|
||||
virtual bool canRestore(const QString &type);
|
||||
virtual QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data);
|
||||
bool canRestore(const QString &type);
|
||||
QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data);
|
||||
|
||||
virtual int priority() const;
|
||||
virtual QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,
|
||||
bool isAutoDetected = false, const QString &autoDetectionSource = QString());
|
||||
int priority() const;
|
||||
QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,
|
||||
bool isAutoDetected = false, const QString &autoDetectionSource = QString());
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -37,16 +37,13 @@
|
||||
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
#include <QIcon>
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
using ProjectExplorer::RunConfiguration;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
AndroidRunControl::AndroidRunControl(AndroidRunConfiguration *rc)
|
||||
: RunControl(rc, ProjectExplorer::NormalRunMode)
|
||||
: RunControl(rc, NormalRunMode)
|
||||
, m_runner(new AndroidRunner(this, rc, false))
|
||||
, m_running(false)
|
||||
{
|
||||
@@ -73,7 +70,7 @@ void AndroidRunControl::start()
|
||||
m_runner->start();
|
||||
}
|
||||
|
||||
ProjectExplorer::RunControl::StopResult AndroidRunControl::stop()
|
||||
RunControl::StopResult AndroidRunControl::stop()
|
||||
{
|
||||
m_runner->stop();
|
||||
return StoppedSynchronously;
|
||||
|
||||
@@ -33,25 +33,25 @@
|
||||
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
class AndroidRunConfiguration;
|
||||
class AndroidRunner;
|
||||
|
||||
class AndroidRunControl : public ProjectExplorer::RunControl
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AndroidRunControl(AndroidRunConfiguration *runConfig);
|
||||
virtual ~AndroidRunControl();
|
||||
~AndroidRunControl();
|
||||
|
||||
virtual void start();
|
||||
virtual StopResult stop();
|
||||
virtual bool isRunning() const;
|
||||
virtual QString displayName() const;
|
||||
virtual QIcon icon() const;
|
||||
void start();
|
||||
StopResult stop();
|
||||
bool isRunning() const;
|
||||
QString displayName() const;
|
||||
QIcon icon() const;
|
||||
|
||||
private slots:
|
||||
void handleRemoteProcessFinished(const QString &error);
|
||||
|
||||
@@ -47,15 +47,16 @@
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Qt4ProjectManager;
|
||||
|
||||
namespace {
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
QString pathFromId(const Core::Id id)
|
||||
#define ANDROID_PREFIX "Qt4ProjectManager.AndroidRunConfiguration"
|
||||
static QLatin1String ANDROID_RC_ID_PREFIX(ANDROID_PREFIX ":");
|
||||
|
||||
static QString pathFromId(const Core::Id id)
|
||||
{
|
||||
QString pathStr = id.toString();
|
||||
const QString prefix = QLatin1String(ANDROID_RC_ID_PREFIX);
|
||||
@@ -64,14 +65,11 @@ QString pathFromId(const Core::Id id)
|
||||
return pathStr.mid(prefix.size());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
AndroidRunConfigurationFactory::AndroidRunConfigurationFactory(QObject *parent)
|
||||
: QmakeRunConfigurationFactory(parent)
|
||||
{ setObjectName(QLatin1String("AndroidRunConfigurationFactory")); }
|
||||
|
||||
AndroidRunConfigurationFactory::~AndroidRunConfigurationFactory()
|
||||
{ }
|
||||
{
|
||||
setObjectName(QLatin1String("AndroidRunConfigurationFactory"));
|
||||
}
|
||||
|
||||
bool AndroidRunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
|
||||
{
|
||||
@@ -88,8 +86,7 @@ bool AndroidRunConfigurationFactory::canRestore(Target *parent, const QVariantMa
|
||||
return id.startsWith(QLatin1String(ANDROID_RC_ID_PREFIX));
|
||||
}
|
||||
|
||||
bool AndroidRunConfigurationFactory::canClone(Target *parent,
|
||||
RunConfiguration *source) const
|
||||
bool AndroidRunConfigurationFactory::canClone(Target *parent, RunConfiguration *source) const
|
||||
{
|
||||
return canCreate(parent, source->id());
|
||||
}
|
||||
@@ -165,10 +162,6 @@ AndroidRunControlFactory::AndroidRunControlFactory(QObject *parent)
|
||||
{
|
||||
}
|
||||
|
||||
AndroidRunControlFactory::~AndroidRunControlFactory()
|
||||
{
|
||||
}
|
||||
|
||||
bool AndroidRunControlFactory::canRun(RunConfiguration *runConfiguration,
|
||||
ProjectExplorer::RunMode mode) const
|
||||
{
|
||||
|
||||
@@ -35,18 +35,11 @@
|
||||
#include <qt4projectmanager/qmakerunconfigurationfactory.h>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class RunControl;
|
||||
class RunConfigWidget;
|
||||
class Target;
|
||||
}
|
||||
|
||||
using ProjectExplorer::IRunControlFactory;
|
||||
using ProjectExplorer::RunConfiguration;
|
||||
using ProjectExplorer::RunControl;
|
||||
using ProjectExplorer::RunConfigWidget;
|
||||
using ProjectExplorer::Target;
|
||||
|
||||
namespace ProjectExplorer { class Node; }
|
||||
class RunControl;
|
||||
class RunConfigWidget;
|
||||
class Target;
|
||||
class Node;
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
@@ -57,37 +50,36 @@ class AndroidRunConfigurationFactory : public Qt4ProjectManager::QmakeRunConfigu
|
||||
|
||||
public:
|
||||
explicit AndroidRunConfigurationFactory(QObject *parent = 0);
|
||||
~AndroidRunConfigurationFactory();
|
||||
|
||||
QString displayNameForId(const Core::Id id) const;
|
||||
QList<Core::Id> availableCreationIds(Target *parent) const;
|
||||
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
|
||||
|
||||
bool canCreate(Target *parent, const Core::Id id) const;
|
||||
RunConfiguration *create(Target *parent, const Core::Id id);
|
||||
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
|
||||
ProjectExplorer::RunConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id);
|
||||
|
||||
bool canRestore(Target *parent, const QVariantMap &map) const;
|
||||
RunConfiguration *restore(Target *parent, const QVariantMap &map);
|
||||
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
|
||||
ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
|
||||
|
||||
bool canClone(Target *parent, RunConfiguration *source) const;
|
||||
RunConfiguration *clone(Target *parent, RunConfiguration *source);
|
||||
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const;
|
||||
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source);
|
||||
|
||||
bool canHandle(ProjectExplorer::Target *t) const;
|
||||
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Target *t,
|
||||
ProjectExplorer::Node *n);
|
||||
};
|
||||
|
||||
class AndroidRunControlFactory : public IRunControlFactory
|
||||
class AndroidRunControlFactory : public ProjectExplorer::IRunControlFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AndroidRunControlFactory(QObject *parent = 0);
|
||||
~AndroidRunControlFactory();
|
||||
|
||||
QString displayName() const;
|
||||
|
||||
bool canRun(RunConfiguration *runConfiguration,
|
||||
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
ProjectExplorer::RunMode mode) const;
|
||||
RunControl *create(RunConfiguration *runConfiguration,
|
||||
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
ProjectExplorer::RunMode mode);
|
||||
};
|
||||
|
||||
|
||||
@@ -34,15 +34,14 @@
|
||||
#include "androidconfigurations.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <QTimer>
|
||||
#include <QThread>
|
||||
#include <QProcess>
|
||||
#include <QMutex>
|
||||
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
class AndroidRunConfiguration;
|
||||
|
||||
class AndroidRunner : public QThread
|
||||
|
||||
@@ -47,18 +47,18 @@
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
void AVDModel::setAvdList(QVector<AndroidDeviceInfo> list)
|
||||
void AvdModel::setAvdList(const QVector<AndroidDeviceInfo> &list)
|
||||
{
|
||||
m_list = list;
|
||||
reset();
|
||||
}
|
||||
|
||||
QString AVDModel::avdName(const QModelIndex &index)
|
||||
QString AvdModel::avdName(const QModelIndex &index)
|
||||
{
|
||||
return m_list[index.row()].serialNumber;
|
||||
}
|
||||
|
||||
QVariant AVDModel::data(const QModelIndex &index, int role) const
|
||||
QVariant AvdModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (role != Qt::DisplayRole || !index.isValid())
|
||||
return QVariant();
|
||||
@@ -73,7 +73,7 @@ QVariant AVDModel::data(const QModelIndex &index, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QVariant AVDModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
QVariant AvdModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
||||
switch (section) {
|
||||
@@ -89,12 +89,12 @@ QVariant AVDModel::headerData(int section, Qt::Orientation orientation, int role
|
||||
return QAbstractItemModel::headerData(section, orientation, role );
|
||||
}
|
||||
|
||||
int AVDModel::rowCount(const QModelIndex &/*parent*/) const
|
||||
int AvdModel::rowCount(const QModelIndex &/*parent*/) const
|
||||
{
|
||||
return m_list.size();
|
||||
}
|
||||
|
||||
int AVDModel::columnCount(const QModelIndex &/*parent*/) const
|
||||
int AvdModel::columnCount(const QModelIndex &/*parent*/) const
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
@@ -34,31 +34,26 @@
|
||||
#include "androidconfigurations.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QSharedPointer>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QLineEdit;
|
||||
class QModelIndex;
|
||||
|
||||
class Ui_AndroidSettingsWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
class AVDModel: public QAbstractTableModel
|
||||
class AvdModel: public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
void setAvdList(QVector<AndroidDeviceInfo> list);
|
||||
void setAvdList(const QVector<AndroidDeviceInfo> &list);
|
||||
QString avdName(const QModelIndex &index);
|
||||
|
||||
protected:
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
|
||||
@@ -110,7 +105,7 @@ private:
|
||||
|
||||
Ui_AndroidSettingsWidget *m_ui;
|
||||
AndroidConfig m_androidConfig;
|
||||
AVDModel m_AVDModel;
|
||||
AvdModel m_AVDModel;
|
||||
bool m_saveSettingsRequested;
|
||||
};
|
||||
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
#include "androidmanager.h"
|
||||
#include "androidqtversion.h"
|
||||
|
||||
#include "qt4projectmanager/qt4projectmanagerconstants.h"
|
||||
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/toolchainmanager.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
@@ -52,18 +50,19 @@
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Qt4ProjectManager;
|
||||
|
||||
static const char ANDROID_QT_VERSION_KEY[] = "Qt4ProjectManager.Android.QtVersion";
|
||||
|
||||
|
||||
AndroidToolChain::AndroidToolChain(bool autodetected) :
|
||||
ProjectExplorer::GccToolChain(QLatin1String(Constants::ANDROID_TOOLCHAIN_ID), autodetected),
|
||||
GccToolChain(QLatin1String(Constants::ANDROID_TOOLCHAIN_ID), autodetected),
|
||||
m_qtVersionId(-1)
|
||||
{}
|
||||
|
||||
AndroidToolChain::AndroidToolChain(const AndroidToolChain &tc) :
|
||||
ProjectExplorer::GccToolChain(tc),
|
||||
GccToolChain(tc),
|
||||
m_qtVersionId(tc.m_qtVersionId)
|
||||
{ }
|
||||
|
||||
@@ -91,7 +90,7 @@ void AndroidToolChain::addToEnvironment(Utils::Environment &env) const
|
||||
// TODO this vars should be configurable in projects -> build tab
|
||||
// TODO invalidate all .pro files !!!
|
||||
|
||||
Qt4Project *qt4pro = qobject_cast<Qt4Project *>(ProjectExplorer::ProjectExplorerPlugin::instance()->currentProject());
|
||||
Qt4Project *qt4pro = qobject_cast<Qt4Project *>(ProjectExplorerPlugin::instance()->currentProject());
|
||||
if (!qt4pro || !qt4pro->activeTarget()
|
||||
|| QtSupport::QtProfileInformation::qtVersion(qt4pro->activeTarget()->profile())->type() != QLatin1String(Constants::ANDROIDQT))
|
||||
return;
|
||||
@@ -116,7 +115,7 @@ void AndroidToolChain::addToEnvironment(Utils::Environment &env) const
|
||||
AndroidConfigurations::instance().bestMatch(AndroidManager::targetSDK(qt4pro->activeTarget())));
|
||||
}
|
||||
|
||||
bool AndroidToolChain::operator ==(const ProjectExplorer::ToolChain &tc) const
|
||||
bool AndroidToolChain::operator ==(const ToolChain &tc) const
|
||||
{
|
||||
if (!ToolChain::operator ==(tc))
|
||||
return false;
|
||||
@@ -125,7 +124,7 @@ bool AndroidToolChain::operator ==(const ProjectExplorer::ToolChain &tc) const
|
||||
return m_qtVersionId == tcPtr->m_qtVersionId;
|
||||
}
|
||||
|
||||
ProjectExplorer::ToolChainConfigWidget *AndroidToolChain::configurationWidget()
|
||||
ToolChainConfigWidget *AndroidToolChain::configurationWidget()
|
||||
{
|
||||
return new AndroidToolChainConfigWidget(this);
|
||||
}
|
||||
@@ -164,7 +163,7 @@ QString AndroidToolChain::makeCommand() const
|
||||
void AndroidToolChain::setQtVersionId(int id)
|
||||
{
|
||||
if (id < 0) {
|
||||
setTargetAbi(ProjectExplorer::Abi());
|
||||
setTargetAbi(Abi());
|
||||
m_qtVersionId = -1;
|
||||
toolChainUpdated();
|
||||
return;
|
||||
@@ -186,14 +185,14 @@ int AndroidToolChain::qtVersionId() const
|
||||
return m_qtVersionId;
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::Abi> AndroidToolChain::detectSupportedAbis() const
|
||||
QList<Abi> AndroidToolChain::detectSupportedAbis() const
|
||||
{
|
||||
if (m_qtVersionId < 0)
|
||||
return QList<ProjectExplorer::Abi>();
|
||||
return QList<Abi>();
|
||||
|
||||
AndroidQtVersion *aqv = dynamic_cast<AndroidQtVersion *>(QtSupport::QtVersionManager::instance()->version(m_qtVersionId));
|
||||
if (!aqv)
|
||||
return QList<ProjectExplorer::Abi>();
|
||||
return QList<Abi>();
|
||||
|
||||
return aqv->qtAbis();
|
||||
}
|
||||
@@ -203,12 +202,10 @@ QList<ProjectExplorer::Abi> AndroidToolChain::detectSupportedAbis() const
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
AndroidToolChainConfigWidget::AndroidToolChainConfigWidget(AndroidToolChain *tc) :
|
||||
ProjectExplorer::ToolChainConfigWidget(tc)
|
||||
ToolChainConfigWidget(tc)
|
||||
{
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
QLabel *label = new QLabel;
|
||||
QtSupport::BaseQtVersion *v = QtSupport::QtVersionManager::instance()->version(tc->qtVersionId());
|
||||
Q_ASSERT(v);
|
||||
label->setText(tr("NDK Root: %1").arg(AndroidConfigurations::instance().config().ndkLocation.toUserOutput()));
|
||||
layout->addWidget(label);
|
||||
}
|
||||
@@ -233,7 +230,7 @@ bool AndroidToolChainConfigWidget::isDirty() const
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
AndroidToolChainFactory::AndroidToolChainFactory() :
|
||||
ProjectExplorer::ToolChainFactory()
|
||||
ToolChainFactory()
|
||||
{ }
|
||||
|
||||
QString AndroidToolChainFactory::displayName() const
|
||||
@@ -246,9 +243,9 @@ QString AndroidToolChainFactory::id() const
|
||||
return QLatin1String(Constants::ANDROID_TOOLCHAIN_ID);
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::ToolChain *> AndroidToolChainFactory::autoDetect()
|
||||
QList<ToolChain *> AndroidToolChainFactory::autoDetect()
|
||||
{
|
||||
QList<ProjectExplorer::ToolChain *> result;
|
||||
QList<ToolChain *> result;
|
||||
|
||||
QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance();
|
||||
connect(vm, SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
|
||||
@@ -266,7 +263,7 @@ bool AndroidToolChainFactory::canRestore(const QVariantMap &data)
|
||||
return idFromMap(data).startsWith(QLatin1String(Constants::ANDROID_TOOLCHAIN_ID) + QLatin1Char(':'));
|
||||
}
|
||||
|
||||
ProjectExplorer::ToolChain *AndroidToolChainFactory::restore(const QVariantMap &data)
|
||||
ToolChain *AndroidToolChainFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
AndroidToolChain *tc = new AndroidToolChain(false);
|
||||
if (tc->fromMap(data))
|
||||
@@ -280,29 +277,29 @@ void AndroidToolChainFactory::handleQtVersionChanges(const QList<int> &added, co
|
||||
{
|
||||
QList<int> changes;
|
||||
changes << added << removed << changed;
|
||||
ProjectExplorer::ToolChainManager *tcm = ProjectExplorer::ToolChainManager::instance();
|
||||
QList<ProjectExplorer::ToolChain *> tcList = createToolChainList(changes);
|
||||
foreach (ProjectExplorer::ToolChain *tc, tcList)
|
||||
ToolChainManager *tcm = ToolChainManager::instance();
|
||||
QList<ToolChain *> tcList = createToolChainList(changes);
|
||||
foreach (ToolChain *tc, tcList)
|
||||
tcm->registerToolChain(tc);
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::ToolChain *> AndroidToolChainFactory::createToolChainList(const QList<int> &changes)
|
||||
QList<ToolChain *> AndroidToolChainFactory::createToolChainList(const QList<int> &changes)
|
||||
{
|
||||
ProjectExplorer::ToolChainManager *tcm = ProjectExplorer::ToolChainManager::instance();
|
||||
ToolChainManager *tcm = ToolChainManager::instance();
|
||||
QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance();
|
||||
QList<ProjectExplorer::ToolChain *> result;
|
||||
QList<ToolChain *> result;
|
||||
|
||||
foreach (int i, changes) {
|
||||
QtSupport::BaseQtVersion *v = vm->version(i);
|
||||
QList<ProjectExplorer::ToolChain *> toRemove;
|
||||
foreach (ProjectExplorer::ToolChain *tc, tcm->toolChains()) {
|
||||
QList<ToolChain *> toRemove;
|
||||
foreach (ToolChain *tc, tcm->toolChains()) {
|
||||
if (tc->id() != QLatin1String(Constants::ANDROID_TOOLCHAIN_ID))
|
||||
continue;
|
||||
AndroidToolChain *aTc = static_cast<AndroidToolChain *>(tc);
|
||||
if (aTc->qtVersionId() == i)
|
||||
toRemove.append(aTc);
|
||||
}
|
||||
foreach (ProjectExplorer::ToolChain *tc, toRemove)
|
||||
foreach (ToolChain *tc, toRemove)
|
||||
tcm->deregisterToolChain(tc);
|
||||
|
||||
const AndroidQtVersion * const aqv = dynamic_cast<AndroidQtVersion *>(v);
|
||||
@@ -312,7 +309,7 @@ QList<ProjectExplorer::ToolChain *> AndroidToolChainFactory::createToolChainList
|
||||
AndroidToolChain *aTc = new AndroidToolChain(true);
|
||||
aTc->setQtVersionId(i);
|
||||
aTc->setDisplayName(tr("Android GCC (%1-%2)")
|
||||
.arg(ProjectExplorer::Abi::toString(aTc->targetAbi().architecture()))
|
||||
.arg(Abi::toString(aTc->targetAbi().architecture()))
|
||||
.arg(AndroidConfigurations::instance().config().ndkToolchainVersion));
|
||||
aTc->setCompilerCommand(AndroidConfigurations::instance().gccPath(aTc->targetAbi().architecture()));
|
||||
result.append(aTc);
|
||||
|
||||
@@ -35,13 +35,8 @@
|
||||
#include <projectexplorer/toolchainconfigwidget.h>
|
||||
|
||||
namespace Android {
|
||||
|
||||
namespace Internal {
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// MaemoToolChain
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class AndroidToolChain : public ProjectExplorer::GccToolChain
|
||||
{
|
||||
public:
|
||||
@@ -61,13 +56,13 @@ public:
|
||||
QVariantMap toMap() const;
|
||||
bool fromMap(const QVariantMap &data);
|
||||
QList<Utils::FileName> suggestedMkspecList() const;
|
||||
virtual QString makeCommand() const;
|
||||
QString makeCommand() const;
|
||||
|
||||
void setQtVersionId(int);
|
||||
int qtVersionId() const;
|
||||
|
||||
protected:
|
||||
virtual QList<ProjectExplorer::Abi> detectSupportedAbis() const;
|
||||
QList<ProjectExplorer::Abi> detectSupportedAbis() const;
|
||||
|
||||
private:
|
||||
explicit AndroidToolChain(bool);
|
||||
|
||||
@@ -37,8 +37,7 @@ using namespace Android::Internal;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
JavaParser::JavaParser() :
|
||||
ProjectExplorer::IOutputParser()
|
||||
, m_javaRegExp(QLatin1String("^(.*\\[javac\\]\\s)(.*\\.java):(\\d+):(.*)$"))
|
||||
m_javaRegExp(QLatin1String("^(.*\\[javac\\]\\s)(.*\\.java):(\\d+):(.*)$"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -65,7 +64,7 @@ void JavaParser::stdError(const QString &line)
|
||||
m_javaRegExp.cap(4).trimmed(),
|
||||
Utils::FileName::fromString(file) /* filename */,
|
||||
lineno,
|
||||
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE);
|
||||
Constants::TASK_CATEGORY_COMPILE);
|
||||
emit addTask(task);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#ifndef JAVAPARSER_H
|
||||
#define JAVAPARSER_H
|
||||
|
||||
#include <projectexplorer/ioutputparser.h>
|
||||
|
||||
namespace Android {
|
||||
@@ -38,11 +39,13 @@ namespace Internal {
|
||||
class JavaParser : public ProjectExplorer::IOutputParser
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
JavaParser();
|
||||
virtual void stdOutput(const QString &line);
|
||||
virtual void stdError(const QString &line);
|
||||
void stdOutput(const QString &line);
|
||||
void stdError(const QString &line);
|
||||
void setProjectFileList(const QStringList &fileList);
|
||||
|
||||
private:
|
||||
QRegExp m_javaRegExp;
|
||||
QStringList m_fileList;
|
||||
|
||||
Reference in New Issue
Block a user