Minor refactoring. Helper method to check ios support

Change-Id: I93045bc5ae9732720239690a16bc81689d0663e5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Vikas Pachdha
2016-07-14 17:42:44 +02:00
parent fd3a082b84
commit e5835bb885
2 changed files with 24 additions and 7 deletions

View File

@@ -40,12 +40,25 @@ using namespace ProjectExplorer;
namespace Ios {
namespace Internal {
bool IosManager::supportsIos(Target *target)
/*!
Returns \c true if the target supports iOS build, \c false otherwise.
*/
bool IosManager::supportsIos(const Target *target)
{
if (!qobject_cast<QmakeProject *>(target->project()))
return false;
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
return version && version->type() == QLatin1String(Ios::Constants::IOSQT);
return qobject_cast<QmakeProject *>(target->project()) && supportsIos(target->kit());
}
/*!
Returns \c true if the kit supports iOS build, \c false otherwise.
*/
bool IosManager::supportsIos(const Kit *kit)
{
bool supports = false;
if (kit) {
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
supports = version && version->type() == QLatin1String(Ios::Constants::IOSQT);
}
return supports;
}
QString IosManager::resDirForTarget(Target *target)