123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- #include "tizendeploypackageinstallationfactory.h"
- #include "tizendeploypackageinstallationstep.h"
- #include <projectexplorer/buildsteplist.h>
- #include <projectexplorer/projectexplorerconstants.h>
- #include <projectexplorer/target.h>
- #include <qtsupport/qtkitinformation.h>
- #include <qtsupport/qtsupportconstants.h>
- using namespace ProjectExplorer;
- namespace Tizen {
- namespace Internal {
- TizenDeployPackageInstallationFactory::TizenDeployPackageInstallationFactory(QObject *parent)
- : IBuildStepFactory(parent)
- {
- }
- QList<Core::Id> TizenDeployPackageInstallationFactory::availableCreationIds(BuildStepList *parent) const
- {
- if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
- return QList<Core::Id>();
- if (parent->contains(TizenDeployPackageInstallationStep::Id))
- return QList<Core::Id>();
- return QList<Core::Id>() << TizenDeployPackageInstallationStep::Id;
- }
- QString TizenDeployPackageInstallationFactory::displayNameForId(const Core::Id id) const
- {
- if (id == TizenDeployPackageInstallationStep::Id)
- return tr("Deploy to device");
- return QString();
- }
- bool TizenDeployPackageInstallationFactory::canCreate(BuildStepList *parent, const Core::Id id) const
- {
- return availableCreationIds(parent).contains(id);
- }
- BuildStep *TizenDeployPackageInstallationFactory::create(BuildStepList *parent, const Core::Id id)
- {
- Q_ASSERT(canCreate(parent, id));
- Q_UNUSED(id);
- return new TizenDeployPackageInstallationStep(parent);
- }
- bool TizenDeployPackageInstallationFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const
- {
- return canCreate(parent, idFromMap(map));
- }
- BuildStep *TizenDeployPackageInstallationFactory::restore(BuildStepList *parent, const QVariantMap &map)
- {
- Q_ASSERT(canRestore(parent, map));
- TizenDeployPackageInstallationStep * const step = new TizenDeployPackageInstallationStep(parent);
- if (!step->fromMap(map)) {
- delete step;
- return 0;
- }
- return step;
- }
- bool TizenDeployPackageInstallationFactory::canClone(BuildStepList *parent, BuildStep *product) const
- {
- return canCreate(parent, product->id());
- }
- BuildStep *TizenDeployPackageInstallationFactory::clone(BuildStepList *parent, BuildStep *product)
- {
- Q_ASSERT(canClone(parent, product));
- return new TizenDeployPackageInstallationStep(parent, static_cast<TizenDeployPackageInstallationStep*>(product));
- }
- }
- }
|