forked from qt-creator/qt-creator
ProjectExplorer: Simplify DeployConfigFactory::availableBuildTargets
It only ever returned either an empty list, or a list with a single empty string. Using a bool return value to distiguish the cases is less convoluted. This is a leftover from the time when a DeployConfigurationFactory could potentially create more than on DeployConfiguration, but this is not supported anymore, as factories are cheap nowadays. Change-Id: I4f2a91d3509d2b978949211ee709863d5ff460c7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -60,20 +60,18 @@ AndroidDeployConfigurationFactory::AndroidDeployConfigurationFactory()
|
||||
setDefaultDisplayName(AndroidDeployConfiguration::tr("Deploy to Android device"));
|
||||
}
|
||||
|
||||
QList<QString> AndroidDeployConfigurationFactory::availableBuildTargets(Target *parent) const
|
||||
bool AndroidDeployConfigurationFactory::hasAvailableBuildTargets(Target *parent) const
|
||||
{
|
||||
if (!parent->project()->id().name().startsWith("QmlProjectManager.QmlProject")) {
|
||||
// Avoid tool chain check for QML Project
|
||||
Core::Id cxxLangId(ProjectExplorer::Constants::CXX_LANGUAGE_ID);
|
||||
ToolChain *tc = ToolChainKitInformation::toolChain(parent->kit(), cxxLangId);
|
||||
if (!tc || tc->targetAbi().osFlavor() != Abi::AndroidLinuxFlavor)
|
||||
return {};
|
||||
return false;
|
||||
}
|
||||
|
||||
QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(parent->kit());
|
||||
if (!qt || qt->type() != Constants::ANDROIDQT)
|
||||
return {};
|
||||
return {QString()};
|
||||
return qt && qt->type() == Constants::ANDROIDQT;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user