diff options
author | Tobias Hunger <tobias.hunger@nokia.com> | 2012-03-15 17:17:40 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@nokia.com> | 2012-04-25 11:49:19 +0200 |
commit | df5dab63827dc01412e7ddbe44ef0bef83b695ca (patch) | |
tree | 92a5c25562a2148acdcd2e9318a1491dfd09b1ee /src/plugins/android/androiddeployconfiguration.cpp | |
parent | cf26765c62f9964ae337f2d52ac261099403d35f (diff) | |
download | qt-creator-df5dab63827dc01412e7ddbe44ef0bef83b695ca.tar.gz |
Use Core::Id in project-related objects
Use Core::Id for all the project related objects in favor of plain
QStrings.
Change-Id: I790ab40cb29899efdb49c413a77609486f52e683
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Diffstat (limited to 'src/plugins/android/androiddeployconfiguration.cpp')
-rw-r--r-- | src/plugins/android/androiddeployconfiguration.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/plugins/android/androiddeployconfiguration.cpp b/src/plugins/android/androiddeployconfiguration.cpp index 78c3f1ee5a..0efd9a46c0 100644 --- a/src/plugins/android/androiddeployconfiguration.cpp +++ b/src/plugins/android/androiddeployconfiguration.cpp @@ -45,7 +45,7 @@ using namespace Android::Internal; AndroidDeployConfiguration::AndroidDeployConfiguration(ProjectExplorer::Target *parent) - :DeployConfiguration(parent, QLatin1String(ANDROID_DEPLOYCONFIGURATION_ID)) + :DeployConfiguration(parent, Core::Id(ANDROID_DEPLOYCONFIGURATION_ID)) { setDisplayName(tr("Deploy to Android device")); setDefaultDisplayName(displayName()); @@ -66,17 +66,18 @@ AndroidDeployConfigurationFactory::AndroidDeployConfigurationFactory(QObject *pa ProjectExplorer::DeployConfigurationFactory(parent) { } -bool AndroidDeployConfigurationFactory::canCreate(ProjectExplorer::Target *parent, const QString &id) const +bool AndroidDeployConfigurationFactory::canCreate(ProjectExplorer::Target *parent, const Core::Id id) const { AndroidTarget *t = qobject_cast<AndroidTarget *>(parent); - if (!t || t->id() != QLatin1String(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID) - || !id.startsWith(QLatin1String(ANDROID_DEPLOYCONFIGURATION_ID))) + if (!t || t->id() != Core::Id(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID) + || !id.toString().startsWith(QLatin1String(ANDROID_DEPLOYCONFIGURATION_ID))) return false; return true; } -ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::create(ProjectExplorer::Target *parent, const QString &/*id*/) +ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::create(ProjectExplorer::Target *parent, const Core::Id id) { + Q_UNUSED(id); AndroidDeployConfiguration *dc = new AndroidDeployConfiguration(parent); if (!dc) return 0; @@ -108,7 +109,7 @@ bool AndroidDeployConfigurationFactory::canClone(ProjectExplorer::Target *parent { if (!qobject_cast<AndroidTarget *>(parent)) return false; - return source->id() == QLatin1String(ANDROID_DEPLOYCONFIGURATION_ID); + return source->id() == Core::Id(ANDROID_DEPLOYCONFIGURATION_ID); } ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) @@ -119,17 +120,20 @@ ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::clone(P return new AndroidDeployConfiguration(t, source); } -QStringList AndroidDeployConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const +QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const { AndroidTarget *target = qobject_cast<AndroidTarget *>(parent); if (!target || - target->id() != QLatin1String(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID)) - return QStringList(); + target->id() != Core::Id(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID)) + return QList<Core::Id>(); - return target->qt4Project()->applicationProFilePathes(QLatin1String(ANDROID_DC_PREFIX)); + QList<Core::Id> result; + foreach (const QString &id, target->qt4Project()->applicationProFilePathes(QLatin1String(ANDROID_DC_PREFIX))) + result << Core::Id(id.toUtf8().constData()); + return result; } -QString AndroidDeployConfigurationFactory::displayNameForId(const QString &/*id*/) const +QString AndroidDeployConfigurationFactory::displayNameForId(const Core::Id/*id*/) const { return tr("Deploy on Android"); } |