Commit df5dab63 authored by Tobias Hunger's avatar Tobias Hunger

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: default avatarDaniel Teske <daniel.teske@nokia.com>
parent cf26765c
...@@ -56,7 +56,7 @@ enum AndroidQemuStatus { ...@@ -56,7 +56,7 @@ enum AndroidQemuStatus {
#define ANDROID_BAT_SUFFIX "" #define ANDROID_BAT_SUFFIX ""
#endif #endif
static const QLatin1String ANDROID_RC_ID(ANDROID_PREFIX); static const char ANDROID_RC_ID[] = ANDROID_PREFIX;
static const QLatin1String ANDROID_RC_ID_PREFIX(ANDROID_PREFIX "."); static const QLatin1String ANDROID_RC_ID_PREFIX(ANDROID_PREFIX ".");
static const QLatin1String AndroidArgumentsKey(ANDROID_PREFIX ".Arguments"); static const QLatin1String AndroidArgumentsKey(ANDROID_PREFIX ".Arguments");
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
using namespace Android::Internal; using namespace Android::Internal;
AndroidDeployConfiguration::AndroidDeployConfiguration(ProjectExplorer::Target *parent) AndroidDeployConfiguration::AndroidDeployConfiguration(ProjectExplorer::Target *parent)
:DeployConfiguration(parent, QLatin1String(ANDROID_DEPLOYCONFIGURATION_ID)) :DeployConfiguration(parent, Core::Id(ANDROID_DEPLOYCONFIGURATION_ID))
{ {
setDisplayName(tr("Deploy to Android device")); setDisplayName(tr("Deploy to Android device"));
setDefaultDisplayName(displayName()); setDefaultDisplayName(displayName());
...@@ -66,17 +66,18 @@ AndroidDeployConfigurationFactory::AndroidDeployConfigurationFactory(QObject *pa ...@@ -66,17 +66,18 @@ AndroidDeployConfigurationFactory::AndroidDeployConfigurationFactory(QObject *pa
ProjectExplorer::DeployConfigurationFactory(parent) 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); AndroidTarget *t = qobject_cast<AndroidTarget *>(parent);
if (!t || t->id() != QLatin1String(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID) if (!t || t->id() != Core::Id(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID)
|| !id.startsWith(QLatin1String(ANDROID_DEPLOYCONFIGURATION_ID))) || !id.toString().startsWith(QLatin1String(ANDROID_DEPLOYCONFIGURATION_ID)))
return false; return false;
return true; 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); AndroidDeployConfiguration *dc = new AndroidDeployConfiguration(parent);
if (!dc) if (!dc)
return 0; return 0;
...@@ -108,7 +109,7 @@ bool AndroidDeployConfigurationFactory::canClone(ProjectExplorer::Target *parent ...@@ -108,7 +109,7 @@ bool AndroidDeployConfigurationFactory::canClone(ProjectExplorer::Target *parent
{ {
if (!qobject_cast<AndroidTarget *>(parent)) if (!qobject_cast<AndroidTarget *>(parent))
return false; 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) ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source)
...@@ -119,17 +120,20 @@ ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::clone(P ...@@ -119,17 +120,20 @@ ProjectExplorer::DeployConfiguration *AndroidDeployConfigurationFactory::clone(P
return new AndroidDeployConfiguration(t, source); 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); AndroidTarget *target = qobject_cast<AndroidTarget *>(parent);
if (!target || if (!target ||
target->id() != QLatin1String(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID)) target->id() != Core::Id(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID))
return QStringList(); 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"); return tr("Deploy on Android");
} }
...@@ -62,16 +62,16 @@ class AndroidDeployConfigurationFactory : public ProjectExplorer::DeployConfigur ...@@ -62,16 +62,16 @@ class AndroidDeployConfigurationFactory : public ProjectExplorer::DeployConfigur
public: public:
explicit AndroidDeployConfigurationFactory(QObject *parent = 0); explicit AndroidDeployConfigurationFactory(QObject *parent = 0);
bool canCreate(ProjectExplorer::Target *parent, const QString &id) const; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, const QString &id); ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id);
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map); ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) const; bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) const;
ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source); ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source);
QStringList availableCreationIds(ProjectExplorer::Target *parent) const; QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
// used to translate the ids to names to display to the user // used to translate the ids to names to display to the user
QString displayNameForId(const QString &id) const; QString displayNameForId(const Core::Id id) const;
}; };
......
...@@ -58,7 +58,7 @@ using namespace Qt4ProjectManager; ...@@ -58,7 +58,7 @@ using namespace Qt4ProjectManager;
namespace Android { namespace Android {
namespace Internal { namespace Internal {
const QLatin1String AndroidDeployStep::Id("Qt4ProjectManager.AndroidDeployStep"); const Core::Id AndroidDeployStep::Id("Qt4ProjectManager.AndroidDeployStep");
AndroidDeployStep::AndroidDeployStep(ProjectExplorer::BuildStepList *parent) AndroidDeployStep::AndroidDeployStep(ProjectExplorer::BuildStepList *parent)
: BuildStep(parent, Id) : BuildStep(parent, Id)
......
...@@ -123,7 +123,7 @@ private: ...@@ -123,7 +123,7 @@ private:
QString m_runQASIPackagePath; QString m_runQASIPackagePath;
AndroidDeployAction m_runDeployAction; AndroidDeployAction m_runDeployAction;
static const QLatin1String Id; static const Core::Id Id;
}; };
} // namespace Internal } // namespace Internal
......
...@@ -51,16 +51,16 @@ AndroidDeployStepFactory::AndroidDeployStepFactory(QObject *parent) ...@@ -51,16 +51,16 @@ AndroidDeployStepFactory::AndroidDeployStepFactory(QObject *parent)
{ {
} }
QStringList AndroidDeployStepFactory::availableCreationIds(BuildStepList *parent) const QList<Core::Id> AndroidDeployStepFactory::availableCreationIds(BuildStepList *parent) const
{ {
if (parent->id() == QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY) if (parent->id() == Core::Id(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
&& parent->target()->id() == QLatin1String(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID) && parent->target()->id() == Core::Id(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID)
&& !parent->contains(AndroidDeployStep::Id)) && !parent->contains(AndroidDeployStep::Id))
return QStringList() << AndroidDeployStep::Id; return QList<Core::Id>() << AndroidDeployStep::Id;
return QStringList(); return QList<Core::Id>();
} }
QString AndroidDeployStepFactory::displayNameForId(const QString &id) const QString AndroidDeployStepFactory::displayNameForId(const Core::Id id) const
{ {
if (id == AndroidDeployStep::Id) if (id == AndroidDeployStep::Id)
return QCoreApplication::translate("Qt4ProjectManager::Internal::AndroidDeployStepFactory", return QCoreApplication::translate("Qt4ProjectManager::Internal::AndroidDeployStepFactory",
...@@ -68,15 +68,15 @@ QString AndroidDeployStepFactory::displayNameForId(const QString &id) const ...@@ -68,15 +68,15 @@ QString AndroidDeployStepFactory::displayNameForId(const QString &id) const
return QString(); return QString();
} }
bool AndroidDeployStepFactory::canCreate(BuildStepList *parent, const QString &id) const bool AndroidDeployStepFactory::canCreate(BuildStepList *parent, const Core::Id id) const
{ {
return parent->id() == QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY) return parent->id() == Core::Id(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
&& id == QLatin1String(AndroidDeployStep::Id) && id == Core::Id(AndroidDeployStep::Id)
&& parent->target()->id() == QLatin1String(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID) && parent->target()->id() == Core::Id(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID)
&& !parent->contains(AndroidDeployStep::Id); && !parent->contains(AndroidDeployStep::Id);
} }
BuildStep *AndroidDeployStepFactory::create(BuildStepList *parent, const QString &id) BuildStep *AndroidDeployStepFactory::create(BuildStepList *parent, const Core::Id id)
{ {
Q_ASSERT(canCreate(parent, id)); Q_ASSERT(canCreate(parent, id));
return new AndroidDeployStep(parent); return new AndroidDeployStep(parent);
......
...@@ -44,24 +44,20 @@ class AndroidDeployStepFactory : public ProjectExplorer::IBuildStepFactory ...@@ -44,24 +44,20 @@ class AndroidDeployStepFactory : public ProjectExplorer::IBuildStepFactory
public: public:
explicit AndroidDeployStepFactory(QObject *parent = 0); explicit AndroidDeployStepFactory(QObject *parent = 0);
virtual QStringList availableCreationIds(ProjectExplorer::BuildStepList *parent) const; QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
virtual QString displayNameForId(const QString &id) const; QString displayNameForId(const Core::Id id) const;
virtual bool canCreate(ProjectExplorer::BuildStepList *parent, bool canCreate(ProjectExplorer::BuildStepList *parent,
const QString &id) const; const Core::Id id) const;
virtual ProjectExplorer::BuildStep * ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
create(ProjectExplorer::BuildStepList *parent, const QString &id);
virtual bool canRestore(ProjectExplorer::BuildStepList *parent, bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
const QVariantMap &map) const; ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
virtual ProjectExplorer::BuildStep *
restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
virtual bool canClone(ProjectExplorer::BuildStepList *parent, bool canClone(ProjectExplorer::BuildStepList *parent,
ProjectExplorer::BuildStep *product) const; ProjectExplorer::BuildStep *product) const;
virtual ProjectExplorer::BuildStep * ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product);
ProjectExplorer::BuildStep *product);
}; };
} // namespace Internal } // namespace Internal
......
...@@ -52,16 +52,16 @@ AndroidPackageCreationFactory::AndroidPackageCreationFactory(QObject *parent) ...@@ -52,16 +52,16 @@ AndroidPackageCreationFactory::AndroidPackageCreationFactory(QObject *parent)
{ {
} }
QStringList AndroidPackageCreationFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const QList<Core::Id> AndroidPackageCreationFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
{ {
if (parent->id() == QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY) if (parent->id() == Core::Id(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
&& parent->target()->id() == QLatin1String(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID) && parent->target()->id() == Core::Id(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID)
&& !parent->contains(AndroidPackageCreationStep::CreatePackageId)) && !parent->contains(AndroidPackageCreationStep::CreatePackageId))
return QStringList() << AndroidPackageCreationStep::CreatePackageId; return QList<Core::Id>() << AndroidPackageCreationStep::CreatePackageId;
return QStringList(); return QList<Core::Id>();
} }
QString AndroidPackageCreationFactory::displayNameForId(const QString &id) const QString AndroidPackageCreationFactory::displayNameForId(const Core::Id id) const
{ {
if (id == AndroidPackageCreationStep::CreatePackageId) if (id == AndroidPackageCreationStep::CreatePackageId)
return QCoreApplication::translate("Qt4ProjectManager::Internal::AndroidPackageCreationFactory", return QCoreApplication::translate("Qt4ProjectManager::Internal::AndroidPackageCreationFactory",
...@@ -69,15 +69,15 @@ QString AndroidPackageCreationFactory::displayNameForId(const QString &id) const ...@@ -69,15 +69,15 @@ QString AndroidPackageCreationFactory::displayNameForId(const QString &id) const
return QString(); return QString();
} }
bool AndroidPackageCreationFactory::canCreate(ProjectExplorer::BuildStepList *parent, const QString &id) const bool AndroidPackageCreationFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
{ {
return parent->id() == QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY) return parent->id() == Core::Id(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
&& id == QLatin1String(AndroidPackageCreationStep::CreatePackageId) && id == Core::Id(AndroidPackageCreationStep::CreatePackageId)
&& parent->target()->id() == QLatin1String(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID) && parent->target()->id() == Core::Id(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID)
&& !parent->contains(AndroidPackageCreationStep::CreatePackageId); && !parent->contains(AndroidPackageCreationStep::CreatePackageId);
} }
BuildStep *AndroidPackageCreationFactory::create(ProjectExplorer::BuildStepList *parent, const QString &id) BuildStep *AndroidPackageCreationFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)
{ {
Q_ASSERT(canCreate(parent, id)); Q_ASSERT(canCreate(parent, id));
return new AndroidPackageCreationStep(parent); return new AndroidPackageCreationStep(parent);
......
...@@ -43,24 +43,21 @@ class AndroidPackageCreationFactory : public ProjectExplorer::IBuildStepFactory ...@@ -43,24 +43,21 @@ class AndroidPackageCreationFactory : public ProjectExplorer::IBuildStepFactory
public: public:
explicit AndroidPackageCreationFactory(QObject *parent = 0); explicit AndroidPackageCreationFactory(QObject *parent = 0);
virtual QStringList availableCreationIds(ProjectExplorer::BuildStepList *parent) const; QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
virtual QString displayNameForId(const QString &id) const; QString displayNameForId(const Core::Id id) const;
virtual bool canCreate(ProjectExplorer::BuildStepList *parent, bool canCreate(ProjectExplorer::BuildStepList *parent,
const QString &id) const; const Core::Id id) const;
virtual ProjectExplorer::BuildStep * ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
create(ProjectExplorer::BuildStepList *parent, const QString &id);
virtual bool canRestore(ProjectExplorer::BuildStepList *parent, bool canRestore(ProjectExplorer::BuildStepList *parent,
const QVariantMap &map) const; const QVariantMap &map) const;
virtual ProjectExplorer::BuildStep * ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
virtual bool canClone(ProjectExplorer::BuildStepList *parent, bool canClone(ProjectExplorer::BuildStepList *parent,
ProjectExplorer::BuildStep *product) const; ProjectExplorer::BuildStep *product) const;
virtual ProjectExplorer::BuildStep * ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product);
ProjectExplorer::BuildStep *product);
}; };
} // namespace Internal } // namespace Internal
......
...@@ -583,7 +583,7 @@ void AndroidPackageCreationStep::raiseError(const QString &shortMsg, ...@@ -583,7 +583,7 @@ void AndroidPackageCreationStep::raiseError(const QString &shortMsg,
TASK_CATEGORY_BUILDSYSTEM)); TASK_CATEGORY_BUILDSYSTEM));
} }
const QLatin1String AndroidPackageCreationStep::CreatePackageId("Qt4ProjectManager.AndroidPackageCreationStep"); const Core::Id AndroidPackageCreationStep::CreatePackageId("Qt4ProjectManager.AndroidPackageCreationStep");
} // namespace Internal } // namespace Internal
} // namespace Qt4ProjectManager } // namespace Qt4ProjectManager
...@@ -107,7 +107,7 @@ private: ...@@ -107,7 +107,7 @@ private:
void raiseError(const QString &shortMsg, void raiseError(const QString &shortMsg,
const QString &detailedMsg = QString()); const QString &detailedMsg = QString());
static const QLatin1String CreatePackageId; static const Core::Id CreatePackageId;
private: private:
QString m_keystorePath; QString m_keystorePath;
......
...@@ -328,9 +328,9 @@ void AndroidPackageCreationWidget::setTargetSDK(const QString &target) ...@@ -328,9 +328,9 @@ void AndroidPackageCreationWidget::setTargetSDK(const QString &target)
qs->setForced(true); qs->setForced(true);
bm->buildList(bc->stepList(QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)), bm->buildList(bc->stepList(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)),
ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_CLEAN))); ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)));
bm->appendStep(qs, ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_CLEAN))); bm->appendStep(qs, ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)));
bc->setSubNodeBuild(0); bc->setSubNodeBuild(0);
// Make the buildconfiguration emit a evironmentChanged() signal // Make the buildconfiguration emit a evironmentChanged() signal
// TODO find a better way // TODO find a better way
......
...@@ -51,16 +51,16 @@ AndroidPackageInstallationFactory::AndroidPackageInstallationFactory(QObject *pa ...@@ -51,16 +51,16 @@ AndroidPackageInstallationFactory::AndroidPackageInstallationFactory(QObject *pa
{ {
} }
QStringList AndroidPackageInstallationFactory::availableCreationIds(BuildStepList *parent) const QList<Core::Id> AndroidPackageInstallationFactory::availableCreationIds(BuildStepList *parent) const
{ {
if (parent->id() == QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY) if (parent->id() == Core::Id(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
&& parent->target()->id() == QLatin1String(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID) && parent->target()->id() == Core::Id(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID)
&& !parent->contains(AndroidPackageInstallationStep::Id)) && !parent->contains(Core::Id(AndroidPackageInstallationStep::Id)))
return QStringList() << AndroidPackageInstallationStep::Id; return QList<Core::Id>() << Core::Id(AndroidPackageInstallationStep::Id);
return QStringList(); return QList<Core::Id>();
} }
QString AndroidPackageInstallationFactory::displayNameForId(const QString &id) const QString AndroidPackageInstallationFactory::displayNameForId(const Core::Id id) const
{ {
if (id == AndroidPackageInstallationStep::Id) if (id == AndroidPackageInstallationStep::Id)
return QCoreApplication::translate("Qt4ProjectManager::Internal::AndroidPackageInstallationFactory", return QCoreApplication::translate("Qt4ProjectManager::Internal::AndroidPackageInstallationFactory",
...@@ -68,15 +68,15 @@ QString AndroidPackageInstallationFactory::displayNameForId(const QString &id) c ...@@ -68,15 +68,15 @@ QString AndroidPackageInstallationFactory::displayNameForId(const QString &id) c
return QString(); return QString();
} }
bool AndroidPackageInstallationFactory::canCreate(BuildStepList *parent, const QString &id) const bool AndroidPackageInstallationFactory::canCreate(BuildStepList *parent, const Core::Id id) const
{ {
return parent->id() == QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY) return parent->id() == Core::Id(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
&& id == QLatin1String(AndroidPackageInstallationStep::Id) && id == Core::Id(AndroidPackageInstallationStep::Id)
&& parent->target()->id() == QLatin1String(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID) && parent->target()->id() == Core::Id(Qt4ProjectManager::Constants::ANDROID_DEVICE_TARGET_ID)
&& !parent->contains(AndroidPackageInstallationStep::Id); && !parent->contains(AndroidPackageInstallationStep::Id);
} }
BuildStep *AndroidPackageInstallationFactory::create(BuildStepList *parent, const QString &id) BuildStep *AndroidPackageInstallationFactory::create(BuildStepList *parent, const Core::Id id)
{ {
Q_ASSERT(canCreate(parent, id)); Q_ASSERT(canCreate(parent, id));
return new AndroidPackageInstallationStep(parent); return new AndroidPackageInstallationStep(parent);
......
...@@ -43,24 +43,21 @@ class AndroidPackageInstallationFactory: public ProjectExplorer::IBuildStepFacto ...@@ -43,24 +43,21 @@ class AndroidPackageInstallationFactory: public ProjectExplorer::IBuildStepFacto
public: public:
explicit AndroidPackageInstallationFactory(QObject *parent = 0); explicit AndroidPackageInstallationFactory(QObject *parent = 0);
virtual QStringList availableCreationIds(ProjectExplorer::BuildStepList *parent) const; QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
virtual QString displayNameForId(const QString &id) const; QString displayNameForId(const Core::Id id) const;
virtual bool canCreate(ProjectExplorer::BuildStepList *parent, bool canCreate(ProjectExplorer::BuildStepList *parent,
const QString &id) const; const Core::Id id) const;
virtual ProjectExplorer::BuildStep * ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
create(ProjectExplorer::BuildStepList *parent, const QString &id);
virtual bool canRestore(ProjectExplorer::BuildStepList *parent, bool canRestore(ProjectExplorer::BuildStepList *parent,
const QVariantMap &map) const;