bool S60DeviceRunConfigurationFactory::canCreate(Target *parent, const QString &id) const { Qt4SymbianTarget *t = qobject_cast<Qt4SymbianTarget *>(parent); if (!t || t->id() != QLatin1String(Constants::S60_DEVICE_TARGET_ID)) return false; return t->qt4Project()->hasApplicationProFile(pathFromId(id)); }
bool S60DeviceRunConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const { Qt4SymbianTarget *t = qobject_cast<Qt4SymbianTarget *>(parent); if (!t || t->id() != QLatin1String(Constants::S60_DEVICE_TARGET_ID)) return false; QString id = ProjectExplorer::idFromMap(map); return id == QLatin1String(S60_DEVICE_RC_ID); }
QStringList S60DeviceRunConfigurationFactory::availableCreationIds(Target *parent) const { Qt4SymbianTarget *target = qobject_cast<Qt4SymbianTarget *>(parent); if (!target || target->id() != QLatin1String(Constants::S60_DEVICE_TARGET_ID)) return QStringList(); return target->qt4Project()->applicationProFilePathes(QLatin1String(S60_DEVICE_RC_PREFIX)); }
QList<Core::Id> S60DeviceRunConfigurationFactory::availableCreationIds(Target *parent) const { QList<Core::Id> result; Qt4SymbianTarget *target = qobject_cast<Qt4SymbianTarget *>(parent); if (!target || target->id() != Core::Id(Constants::S60_DEVICE_TARGET_ID)) return result; QStringList proFiles = target->qt4Project()->applicationProFilePathes(QLatin1String(S60_DEVICE_RC_PREFIX)); foreach (const QString &pf, proFiles) result << Core::Id(pf.toUtf8().constData()); return result; }
ProjectExplorer::Target *Qt4SymbianTargetFactory::restore(ProjectExplorer::Project *parent, const QVariantMap &map) { if (!canRestore(parent, map)) return 0; Qt4Project *qt4project = static_cast<Qt4Project *>(parent); Qt4SymbianTarget *target = new Qt4SymbianTarget(qt4project, idFromMap(map)); if (target->fromMap(map)) return target; delete target; return 0; }
ProjectExplorer::Target *Qt4SymbianTargetFactory::create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos) { if (!canCreate(parent, id)) return 0; Qt4SymbianTarget *t = new Qt4SymbianTarget(static_cast<Qt4Project *>(parent), id); foreach (const BuildConfigurationInfo &info, infos) t->addQt4BuildConfiguration(msgBuildConfigurationName(info), QString(), info.version, info.buildConfig, info.additionalArguments, info.directory, info.importing); t->addDeployConfiguration(t->createDeployConfiguration(QLatin1String(S60_DEPLOYCONFIGURATION_ID))); t->createApplicationProFiles(false); if (t->runConfigurations().isEmpty()) t->addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(t)); return t; }