123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- #include "tizenpackageinstallationfactory.h"
- #include "tizenpackageinstallationstep.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 {
- TizenPackageInstallationFactory::TizenPackageInstallationFactory(QObject *parent)
- : IBuildStepFactory(parent)
- {
- }
- QList<Core::Id> TizenPackageInstallationFactory::availableCreationIds(BuildStepList *parent) const
- {
- if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
- return QList<Core::Id>();
- if (parent->contains(TizenPackageInstallationStep::Id))
- return QList<Core::Id>();
- return QList<Core::Id>() << TizenPackageInstallationStep::Id;
- }
- QString TizenPackageInstallationFactory::displayNameForId(const Core::Id id) const
- {
- if (id == TizenPackageInstallationStep::Id)
- return tr("Deploy to device");
- return QString();
- }
- bool TizenPackageInstallationFactory::canCreate(BuildStepList *parent, const Core::Id id) const
- {
- return availableCreationIds(parent).contains(id);
- }
- BuildStep *TizenPackageInstallationFactory::create(BuildStepList *parent, const Core::Id id)
- {
- Q_ASSERT(canCreate(parent, id));
- Q_UNUSED(id);
- return new TizenPackageInstallationStep(parent);
- }
- bool TizenPackageInstallationFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const
- {
- return canCreate(parent, idFromMap(map));
- }
- BuildStep *TizenPackageInstallationFactory::restore(BuildStepList *parent, const QVariantMap &map)
- {
- Q_ASSERT(canRestore(parent, map));
- TizenPackageInstallationStep * const step = new TizenPackageInstallationStep(parent);
- if (!step->fromMap(map)) {
- delete step;
- return 0;
- }
- return step;
- }
- bool TizenPackageInstallationFactory::canClone(BuildStepList *parent, BuildStep *product) const
- {
- return canCreate(parent, product->id());
- }
- BuildStep *TizenPackageInstallationFactory::clone(BuildStepList *parent, BuildStep *product)
- {
- Q_ASSERT(canClone(parent, product));
- return new TizenPackageInstallationStep(parent, static_cast<TizenPackageInstallationStep*>(product));
- }
- }
- }
|