diff options
author | hjk <qthjk@ovi.com> | 2012-08-09 01:56:51 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-08-12 22:40:41 +0200 |
commit | bab670af672833d38762512e8161ce22e2885995 (patch) | |
tree | 77ec590c8aafccec46a20435f9cd56245f8a0c86 /src/plugins/android | |
parent | d215470bb08ff35fdb6902c2412f3f6a6303ebc4 (diff) | |
download | qt-creator-bab670af672833d38762512e8161ce22e2885995.tar.gz |
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>
Diffstat (limited to 'src/plugins/android')
40 files changed, 235 insertions, 326 deletions
diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index acca04a2ea..c2d313d95b 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -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)); diff --git a/src/plugins/android/androidconfigurations.h b/src/plugins/android/androidconfigurations.h index 5d52d37df2..cafdefd4d8 100644 --- a/src/plugins/android/androidconfigurations.h +++ b/src/plugins/android/androidconfigurations.h @@ -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); diff --git a/src/plugins/android/androidconstants.h b/src/plugins/android/androidconstants.h index b498816d7f..19d6157752 100644 --- a/src/plugins/android/androidconstants.h +++ b/src/plugins/android/androidconstants.h @@ -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 diff --git a/src/plugins/android/androidcreatekeystorecertificate.h b/src/plugins/android/androidcreatekeystorecertificate.h index 04e581d3ad..8ecbff804f 100644 --- a/src/plugins/android/androidcreatekeystorecertificate.h +++ b/src/plugins/android/androidcreatekeystorecertificate.h @@ -41,6 +41,7 @@ QT_END_NAMESPACE namespace Android { namespace Internal { + class AndroidCreateKeystoreCertificate : public QDialog { Q_OBJECT diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp index 5e20cd6771..79f81ebaab 100644 --- a/src/plugins/android/androiddebugsupport.cpp +++ b/src/plugins/android/androiddebugsupport.cpp @@ -191,4 +191,4 @@ QStringList AndroidDebugSupport::qtSoPaths(QtSupport::BaseQtVersion *qtVersion) } } // namespace Internal -} // namespace Qt4ProjectManager +} // namespace Android diff --git a/src/plugins/android/androiddebugsupport.h b/src/plugins/android/androiddebugsupport.h index 203418007f..790d1f25ae 100644 --- a/src/plugins/android/androiddebugsupport.h +++ b/src/plugins/android/androiddebugsupport.h @@ -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); diff --git a/src/plugins/android/androiddeployconfiguration.cpp b/src/plugins/android/androiddeployconfiguration.cpp index 06ab2da6da..8cd678d73e 100644 --- a/src/plugins/android/androiddeployconfiguration.cpp +++ b/src/plugins/android/androiddeployconfiguration.cpp @@ -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 diff --git a/src/plugins/android/androiddeployconfiguration.h b/src/plugins/android/androiddeployconfiguration.h index cea29a25ec..435420957f 100644 --- a/src/plugins/android/androiddeployconfiguration.h +++ b/src/plugins/android/androiddeployconfiguration.h @@ -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 diff --git a/src/plugins/android/androiddeploystepfactory.cpp b/src/plugins/android/androiddeploystepfactory.cpp index fb88034f77..a19fe3f966 100644 --- a/src/plugins/android/androiddeploystepfactory.cpp +++ b/src/plugins/android/androiddeploystepfactory.cpp @@ -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); } diff --git a/src/plugins/android/androiddeploystepwidget.h b/src/plugins/android/androiddeploystepwidget.h index 14b032faaf..5994af1ffc 100644 --- a/src/plugins/android/androiddeploystepwidget.h +++ b/src/plugins/android/androiddeploystepwidget.h @@ -34,9 +34,7 @@ #include <projectexplorer/buildstep.h> QT_BEGIN_NAMESPACE -namespace Ui { - class AndroidDeployStepWidget; -} +namespace Ui { class AndroidDeployStepWidget; } QT_END_NAMESPACE namespace Android { diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index 42e698e044..340ad51206 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -49,7 +49,7 @@ AndroidDevice::AndroidDevice() } AndroidDevice::AndroidDevice(const AndroidDevice &other) - : ProjectExplorer::IDevice(other) + : IDevice(other) { } diff --git a/src/plugins/android/androiddevicefactory.cpp b/src/plugins/android/androiddevicefactory.cpp index ae5a9e8d76..1952577d30 100644 --- a/src/plugins/android/androiddevicefactory.cpp +++ b/src/plugins/android/androiddevicefactory.cpp @@ -32,7 +32,6 @@ #include "androiddevice.h" #include "androidconstants.h" -#include <coreplugin/id.h> namespace Android { namespace Internal { diff --git a/src/plugins/android/androidglobal.h b/src/plugins/android/androidglobal.h index 8f415885e2..e1f06ec516 100644 --- a/src/plugins/android/androidglobal.h +++ b/src/plugins/android/androidglobal.h @@ -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 { diff --git a/src/plugins/android/androidmanager.h b/src/plugins/android/androidmanager.h index f8946ddeb6..a8fb9b7783 100644 --- a/src/plugins/android/androidmanager.h +++ b/src/plugins/android/androidmanager.h @@ -40,8 +40,6 @@ namespace ProjectExplorer { class Target; } namespace Android { -class AndroidPlugin; - namespace Internal { class AndroidManager : public QObject diff --git a/src/plugins/android/androidpackagecreationfactory.cpp b/src/plugins/android/androidpackagecreationfactory.cpp index 1a98e00aff..7f7b9b0a4c 100644 --- a/src/plugins/android/androidpackagecreationfactory.cpp +++ b/src/plugins/android/androidpackagecreationfactory.cpp @@ -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)); diff --git a/src/plugins/android/androidpackagecreationstep.cpp b/src/plugins/android/androidpackagecreationstep.cpp index acaaddd609..485eabec54 100644 --- a/src/plugins/android/androidpackagecreationstep.cpp +++ b/src/plugins/android/androidpackagecreationstep.cpp @@ -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")); diff --git a/src/plugins/android/androidpackagecreationstep.h b/src/plugins/android/androidpackagecreationstep.h index 6959e1a73d..240c711f16 100644 --- a/src/plugins/android/androidpackagecreationstep.h +++ b/src/plugins/android/androidpackagecreationstep.h @@ -31,14 +31,14 @@ #ifndef ANDROIDPACKAGECREATIONSTEP_H #define ANDROIDPACKAGECREATIONSTEP_H +#include "javaparser.h" + #include <projectexplorer/abi.h> #include <projectexplorer/buildstep.h> + #include <QAbstractItemModel> -#include "javaparser.h" 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 diff --git a/src/plugins/android/androidpackagecreationwidget.cpp b/src/plugins/android/androidpackagecreationwidget.cpp index 7f8f3869c2..9dcf9b79a3 100644 --- a/src/plugins/android/androidpackagecreationwidget.cpp +++ b/src/plugins/android/androidpackagecreationwidget.cpp @@ -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(); diff --git a/src/plugins/android/androidpackagecreationwidget.h b/src/plugins/android/androidpackagecreationwidget.h index 4576722f01..dbf76d14e1 100644 --- a/src/plugins/android/androidpackagecreationwidget.h +++ b/src/plugins/android/androidpackagecreationwidget.h @@ -32,6 +32,7 @@ #define ANDROIDPACKAGECREATIONWIDGET_H #include <projectexplorer/buildstep.h> + #include <QAbstractListModel> #include <QStringList> diff --git a/src/plugins/android/androidpackageinstallationfactory.cpp b/src/plugins/android/androidpackageinstallationfactory.cpp index a48985ff2f..0bd36954cc 100644 --- a/src/plugins/android/androidpackageinstallationfactory.cpp +++ b/src/plugins/android/androidpackageinstallationfactory.cpp @@ -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); } diff --git a/src/plugins/android/androidpackageinstallationfactory.h b/src/plugins/android/androidpackageinstallationfactory.h index 6cddbce11e..1399514422 100644 --- a/src/plugins/android/androidpackageinstallationfactory.h +++ b/src/plugins/android/androidpackageinstallationfactory.h @@ -30,6 +30,7 @@ #ifndef ANDROIDPACKAGEINSTALLATIONFACTORY_H #define ANDROIDPACKAGEINSTALLATIONFACTORY_H + #include <projectexplorer/buildstep.h> namespace Android { diff --git a/src/plugins/android/androidpackageinstallationstep.cpp b/src/plugins/android/androidpackageinstallationstep.cpp index cd71652729..477cb70383 100644 --- a/src/plugins/android/androidpackageinstallationstep.cpp +++ b/src/plugins/android/androidpackageinstallationstep.cpp @@ -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() diff --git a/src/plugins/android/androidpackageinstallationstep.h b/src/plugins/android/androidpackageinstallationstep.h index 64bd96397a..2342b5fe5a 100644 --- a/src/plugins/android/androidpackageinstallationstep.h +++ b/src/plugins/android/androidpackageinstallationstep.h @@ -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; }; diff --git a/src/plugins/android/androidplugin.cpp b/src/plugins/android/androidplugin.cpp index a2fd1c764c..d15c5b6439 100644 --- a/src/plugins/android/androidplugin.cpp +++ b/src/plugins/android/androidplugin.cpp @@ -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); diff --git a/src/plugins/android/androidplugin.h b/src/plugins/android/androidplugin.h index 02e37a4a69..7b7987f294 100644 --- a/src/plugins/android/androidplugin.h +++ b/src/plugins/android/androidplugin.h @@ -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(); }; diff --git a/src/plugins/android/androidqtversion.cpp b/src/plugins/android/androidqtversion.cpp index 5c61c7d89c..026c82acea 100644 --- a/src/plugins/android/androidqtversion.cpp +++ b/src/plugins/android/androidqtversion.cpp @@ -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); diff --git a/src/plugins/android/androidqtversion.h b/src/plugins/android/androidqtversion.h index 6dd4df85be..53d220037c 100644 --- a/src/plugins/android/androidqtversion.h +++ b/src/plugins/android/androidqtversion.h @@ -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; + AndroidQtVersion *clone() const; QString type() const; - bool isValid() const; QString invalidReason() const; diff --git a/src/plugins/android/androidqtversionfactory.cpp b/src/plugins/android/androidqtversionfactory.cpp index 616996edf8..1a677de9eb 100644 --- a/src/plugins/android/androidqtversionfactory.cpp +++ b/src/plugins/android/androidqtversionfactory.cpp @@ -43,12 +43,6 @@ namespace Internal { AndroidQtVersionFactory::AndroidQtVersionFactory(QObject *parent) : QtSupport::QtVersionFactory(parent) { - -} - -AndroidQtVersionFactory::~AndroidQtVersionFactory() -{ - } bool AndroidQtVersionFactory::canRestore(const QString &type) diff --git a/src/plugins/android/androidqtversionfactory.h b/src/plugins/android/androidqtversionfactory.h index 8613bf8809..d72928c938 100644 --- a/src/plugins/android/androidqtversionfactory.h +++ b/src/plugins/android/androidqtversionfactory.h @@ -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 diff --git a/src/plugins/android/androidruncontrol.cpp b/src/plugins/android/androidruncontrol.cpp index a626bc096e..0597668ebe 100644 --- a/src/plugins/android/androidruncontrol.cpp +++ b/src/plugins/android/androidruncontrol.cpp @@ -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; diff --git a/src/plugins/android/androidruncontrol.h b/src/plugins/android/androidruncontrol.h index f1a42deae4..c1ecee8b67 100644 --- a/src/plugins/android/androidruncontrol.h +++ b/src/plugins/android/androidruncontrol.h @@ -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); diff --git a/src/plugins/android/androidrunfactories.cpp b/src/plugins/android/androidrunfactories.cpp index ee4beac7d8..66383a1b8a 100644 --- a/src/plugins/android/androidrunfactories.cpp +++ b/src/plugins/android/androidrunfactories.cpp @@ -47,15 +47,16 @@ #include <qtsupport/qtsupportconstants.h> -namespace Android { -namespace Internal { - using namespace ProjectExplorer; using namespace Qt4ProjectManager; -namespace { +namespace Android { +namespace Internal { + +#define ANDROID_PREFIX "Qt4ProjectManager.AndroidRunConfiguration" +static QLatin1String ANDROID_RC_ID_PREFIX(ANDROID_PREFIX ":"); -QString pathFromId(const Core::Id id) +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 { diff --git a/src/plugins/android/androidrunfactories.h b/src/plugins/android/androidrunfactories.h index bc3d8497d4..6c16456ad5 100644 --- a/src/plugins/android/androidrunfactories.h +++ b/src/plugins/android/androidrunfactories.h @@ -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); }; diff --git a/src/plugins/android/androidrunner.h b/src/plugins/android/androidrunner.h index 14bba02421..f7424128ad 100644 --- a/src/plugins/android/androidrunner.h +++ b/src/plugins/android/androidrunner.h @@ -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 diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index 9dfbce194b..ae6b7ac229 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -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; } diff --git a/src/plugins/android/androidsettingswidget.h b/src/plugins/android/androidsettingswidget.h index 21d5536a88..1755418dcb 100644 --- a/src/plugins/android/androidsettingswidget.h +++ b/src/plugins/android/androidsettingswidget.h @@ -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; }; diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index 0fca6e8a43..ef88ec2a15 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -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); diff --git a/src/plugins/android/androidtoolchain.h b/src/plugins/android/androidtoolchain.h index 5f8a6d6204..f91310e941 100644 --- a/src/plugins/android/androidtoolchain.h +++ b/src/plugins/android/androidtoolchain.h @@ -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); diff --git a/src/plugins/android/javaparser.cpp b/src/plugins/android/javaparser.cpp index 51a5d8e600..d487fd3c87 100644 --- a/src/plugins/android/javaparser.cpp +++ b/src/plugins/android/javaparser.cpp @@ -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; } diff --git a/src/plugins/android/javaparser.h b/src/plugins/android/javaparser.h index b0ccf202d2..1338c6838a 100644 --- a/src/plugins/android/javaparser.h +++ b/src/plugins/android/javaparser.h @@ -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; |