forked from qt-creator/qt-creator
ProjectExplorer: Remove BuildTargetInfoList wrapper class
Change-Id: I1a2ae06ec8c5b7278abca2386834d7edd31597d7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -86,8 +86,7 @@ ChooseProFilePage::ChooseProFilePage(CreateAndroidManifestWizard *wizard)
|
||||
currentBuildTarget = rc->buildKey();
|
||||
|
||||
m_comboBox = new QComboBox(this);
|
||||
const BuildTargetInfoList buildTargets = wizard->target()->applicationTargets();
|
||||
for (const BuildTargetInfo &bti : buildTargets.list) {
|
||||
for (const BuildTargetInfo &bti : wizard->target()->applicationTargets()) {
|
||||
const QString displayName = bti.buildKey;
|
||||
m_comboBox->addItem(displayName, QVariant(bti.buildKey)); // TODO something more?
|
||||
if (bti.buildKey == currentBuildTarget)
|
||||
@@ -214,15 +213,15 @@ CreateAndroidManifestWizard::CreateAndroidManifestWizard(ProjectExplorer::Target
|
||||
{
|
||||
setWindowTitle(tr("Create Android Template Files Wizard"));
|
||||
|
||||
const BuildTargetInfoList buildTargets = target->applicationTargets();
|
||||
const QList<BuildTargetInfo> buildTargets = target->applicationTargets();
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(target->kit());
|
||||
m_copyGradle = version && version->qtVersion() >= QtSupport::QtVersionNumber(5, 4, 0);
|
||||
|
||||
if (buildTargets.list.isEmpty()) {
|
||||
if (buildTargets.isEmpty()) {
|
||||
// oh uhm can't create anything
|
||||
addPage(new NoApplicationProFilePage(this));
|
||||
} else if (buildTargets.list.size() == 1) {
|
||||
setBuildKey(buildTargets.list.first().buildKey);
|
||||
} else if (buildTargets.size() == 1) {
|
||||
setBuildKey(buildTargets.first().buildKey);
|
||||
addPage(new ChooseDirectoryPage(this));
|
||||
} else {
|
||||
addPage(new ChooseProFilePage(this));
|
||||
|
||||
@@ -140,7 +140,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode)
|
||||
const QSet<QString> buildSystemTargets = m_buildTargets;
|
||||
qCDebug(LOG) << "BuildSystemTargets\n " << buildSystemTargets;
|
||||
BuildTargetInfo targetInfo
|
||||
= Utils::findOrDefault(target->applicationTargets().list,
|
||||
= Utils::findOrDefault(target->applicationTargets(),
|
||||
[&buildSystemTargets] (const BuildTargetInfo &bti) {
|
||||
return buildSystemTargets.contains(bti.buildKey);
|
||||
});
|
||||
@@ -148,7 +148,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode)
|
||||
// there would be no BuildTargetInfo that could match
|
||||
if (targetInfo.targetFilePath.isEmpty()) {
|
||||
qCDebug(LOG) << "BuildTargetInfos";
|
||||
const QList<BuildTargetInfo> buildTargets = target->applicationTargets().list;
|
||||
const QList<BuildTargetInfo> buildTargets = target->applicationTargets();
|
||||
// if there is only one build target just use it (but be honest that we're deducing)
|
||||
if (buildTargets.size() == 1) {
|
||||
targetInfo = buildTargets.first();
|
||||
|
||||
@@ -192,9 +192,9 @@ bool CMakeBuildConfiguration::isParsing() const
|
||||
return project()->isParsing() && isActive();
|
||||
}
|
||||
|
||||
BuildTargetInfoList CMakeBuildConfiguration::appTargets() const
|
||||
const QList<BuildTargetInfo> CMakeBuildConfiguration::appTargets() const
|
||||
{
|
||||
BuildTargetInfoList appTargetList;
|
||||
QList<BuildTargetInfo> appTargetList;
|
||||
bool forAndroid = DeviceTypeKitAspect::deviceTypeId(target()->kit()) == Android::Constants::ANDROID_DEVICE_TYPE;
|
||||
for (const CMakeBuildTarget &ct : m_buildTargets) {
|
||||
if (ct.targetType == UtilityType)
|
||||
@@ -208,7 +208,7 @@ BuildTargetInfoList CMakeBuildConfiguration::appTargets() const
|
||||
bti.projectFilePath.appendString('/');
|
||||
bti.workingDirectory = ct.workingDirectory;
|
||||
bti.buildKey = CMakeTargetNode::generateId(ct.sourceDirectory, ct.title);
|
||||
appTargetList.list.append(bti);
|
||||
appTargetList.append(bti);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
|
||||
QStringList buildTargetTitles() const;
|
||||
const QList<CMakeBuildTarget> &buildTargets() const;
|
||||
ProjectExplorer::BuildTargetInfoList appTargets() const;
|
||||
const QList<ProjectExplorer::BuildTargetInfo> appTargets() const;
|
||||
ProjectExplorer::DeploymentData deploymentData() const;
|
||||
|
||||
static Utils::FileName
|
||||
|
||||
@@ -78,7 +78,7 @@ void CMakeRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo
|
||||
|
||||
bool CMakeRunConfiguration::isBuildTargetValid() const
|
||||
{
|
||||
return Utils::anyOf(target()->applicationTargets().list, [this](const BuildTargetInfo &bti) {
|
||||
return Utils::anyOf(target()->applicationTargets(), [this](const BuildTargetInfo &bti) {
|
||||
return bti.buildKey == buildKey();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -642,10 +642,7 @@ CompilationDatabaseBuildConfiguration::CompilationDatabaseBuildConfiguration(
|
||||
ProjectExplorer::Target *target, Core::Id id)
|
||||
: ProjectExplorer::BuildConfiguration(target, id)
|
||||
{
|
||||
BuildTargetInfoList appTargetList;
|
||||
BuildTargetInfo bti;
|
||||
appTargetList.list.append(bti);
|
||||
target->setApplicationTargets(appTargetList);
|
||||
target->setApplicationTargets({BuildTargetInfo()});
|
||||
}
|
||||
|
||||
void CompilationDatabaseBuildConfiguration::initialize(const ProjectExplorer::BuildInfo &info)
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QList>
|
||||
#include <QSet>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
@@ -76,10 +75,4 @@ inline uint qHash(const BuildTargetInfo &ti)
|
||||
return qHash(ti.displayName) ^ qHash(ti.buildKey);
|
||||
}
|
||||
|
||||
class PROJECTEXPLORER_EXPORT BuildTargetInfoList
|
||||
{
|
||||
public:
|
||||
QList<BuildTargetInfo> list;
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
@@ -453,7 +453,7 @@ QString RunConfigurationFactory::decoratedTargetName(const QString &targetName,
|
||||
QList<RunConfigurationCreationInfo>
|
||||
RunConfigurationFactory::availableCreators(Target *parent) const
|
||||
{
|
||||
const QList<BuildTargetInfo> buildTargets = parent->applicationTargets().list;
|
||||
const QList<BuildTargetInfo> buildTargets = parent->applicationTargets();
|
||||
const bool hasAnyQtcRunnable = Utils::anyOf(buildTargets,
|
||||
Utils::equal(&BuildTargetInfo::isQtcRunnable, true));
|
||||
return Utils::transform(buildTargets, [&](const BuildTargetInfo &ti) {
|
||||
@@ -496,8 +496,6 @@ void RunConfigurationFactory::setDecorateDisplayNames(bool on)
|
||||
m_decorateDisplayNames = on;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void RunConfigurationFactory::addSupportedProjectType(Core::Id id)
|
||||
{
|
||||
m_supportedProjectTypes.append(id);
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
QList<RunConfiguration *> m_runConfigurations;
|
||||
RunConfiguration* m_activeRunConfiguration = nullptr;
|
||||
DeploymentData m_deploymentData;
|
||||
BuildTargetInfoList m_appTargets;
|
||||
QList<BuildTargetInfo> m_appTargets;
|
||||
QVariantMap m_pluginSettings;
|
||||
|
||||
Kit *const m_kit;
|
||||
@@ -345,22 +345,22 @@ DeploymentData Target::deploymentData() const
|
||||
return d->m_deploymentData;
|
||||
}
|
||||
|
||||
void Target::setApplicationTargets(const BuildTargetInfoList &appTargets)
|
||||
void Target::setApplicationTargets(const QList<BuildTargetInfo> &appTargets)
|
||||
{
|
||||
if (appTargets.list.toSet() != d->m_appTargets.list.toSet()) {
|
||||
if (appTargets.toSet() != d->m_appTargets.toSet()) {
|
||||
d->m_appTargets = appTargets;
|
||||
emit applicationTargetsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
BuildTargetInfoList Target::applicationTargets() const
|
||||
const QList<BuildTargetInfo> Target::applicationTargets() const
|
||||
{
|
||||
return d->m_appTargets;
|
||||
}
|
||||
|
||||
BuildTargetInfo Target::buildTarget(const QString &buildKey) const
|
||||
{
|
||||
return Utils::findOrDefault(d->m_appTargets.list, [&buildKey](const BuildTargetInfo &ti) {
|
||||
return Utils::findOrDefault(d->m_appTargets, [&buildKey](const BuildTargetInfo &ti) {
|
||||
return ti.buildKey == buildKey;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ QT_FORWARD_DECLARE_CLASS(QIcon)
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class BuildConfiguration;
|
||||
class BuildTargetInfoList;
|
||||
class BuildTargetInfo;
|
||||
class DeployConfiguration;
|
||||
class DeploymentData;
|
||||
@@ -82,8 +81,8 @@ public:
|
||||
void setDeploymentData(const DeploymentData &deploymentData);
|
||||
DeploymentData deploymentData() const;
|
||||
|
||||
void setApplicationTargets(const BuildTargetInfoList &appTargets);
|
||||
BuildTargetInfoList applicationTargets() const;
|
||||
void setApplicationTargets(const QList<BuildTargetInfo> &appTargets);
|
||||
const QList<BuildTargetInfo> applicationTargets() const;
|
||||
BuildTargetInfo buildTarget(const QString &buildKey) const;
|
||||
|
||||
QList<ProjectConfiguration *> projectConfigurations() const;
|
||||
|
||||
@@ -551,7 +551,7 @@ void PythonProject::refresh(Target *target)
|
||||
parseProject();
|
||||
|
||||
const QDir baseDir(projectDirectory().toString());
|
||||
BuildTargetInfoList appTargets;
|
||||
QList<BuildTargetInfo> appTargets;
|
||||
auto newRoot = std::make_unique<PythonProjectNode>(this);
|
||||
for (const QString &f : qAsConst(m_files)) {
|
||||
const QString displayName = baseDir.relativeFilePath(f);
|
||||
@@ -564,7 +564,7 @@ void PythonProject::refresh(Target *target)
|
||||
bti.buildKey = f;
|
||||
bti.targetFilePath = FileName::fromString(f);
|
||||
bti.projectFilePath = projectFilePath();
|
||||
appTargets.list.append(bti);
|
||||
appTargets.append(bti);
|
||||
}
|
||||
}
|
||||
setRootProjectNode(std::move(newRoot));
|
||||
|
||||
@@ -1079,7 +1079,7 @@ void QbsProject::updateQmlJsCodeModel()
|
||||
|
||||
void QbsProject::updateApplicationTargets()
|
||||
{
|
||||
BuildTargetInfoList applications;
|
||||
QList<BuildTargetInfo> applications;
|
||||
foreach (const qbs::ProductData &productData, m_projectData.allProducts()) {
|
||||
if (!productData.isEnabled() || !productData.isRunnable())
|
||||
continue;
|
||||
@@ -1125,7 +1125,7 @@ void QbsProject::updateApplicationTargets()
|
||||
}
|
||||
};
|
||||
|
||||
applications.list.append(bti);
|
||||
applications.append(bti);
|
||||
}
|
||||
if (activeTarget())
|
||||
activeTarget()->setApplicationTargets(applications);
|
||||
|
||||
@@ -947,7 +947,7 @@ void QmakeProject::updateBuildSystemData()
|
||||
collectData(file, deploymentData);
|
||||
target->setDeploymentData(deploymentData);
|
||||
|
||||
BuildTargetInfoList appTargetList;
|
||||
QList<BuildTargetInfo> appTargetList;
|
||||
|
||||
rootProjectNode()->forEachProjectNode([this, target, &appTargetList](const ProjectNode *pn) {
|
||||
auto node = dynamic_cast<const QmakeProFileNode *>(pn);
|
||||
@@ -1031,7 +1031,7 @@ void QmakeProject::updateBuildSystemData()
|
||||
env.prependOrSetLibrarySearchPaths(libraryPaths);
|
||||
};
|
||||
|
||||
appTargetList.list.append(bti);
|
||||
appTargetList.append(bti);
|
||||
});
|
||||
|
||||
target->setApplicationTargets(appTargetList);
|
||||
|
||||
Reference in New Issue
Block a user