ProjectExplorer: Rename KitInformation to KitAspect

The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2019-02-06 12:50:51 +01:00
parent 46c287fee5
commit 83dd031960
156 changed files with 1156 additions and 1156 deletions

View File

@@ -58,7 +58,7 @@ QList<ProjectExplorer::NamedWidget *> IosBuildConfiguration::createSubConfigWidg
{
auto subConfigWidgets = QmakeBuildConfiguration::createSubConfigWidgets();
Core::Id devType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit());
Core::Id devType = ProjectExplorer::DeviceTypeKitAspect::deviceTypeId(target()->kit());
// Ownership of this widget is with BuildSettingsWidget
auto buildSettingsWidget = new IosBuildSettingsWidget(devType, m_signingIdentifier,
m_autoManagedSigning);
@@ -113,7 +113,7 @@ void IosBuildConfiguration::updateQmakeCommand()
if (!m_signingIdentifier.isEmpty() )
extraArgs << forceOverrideArg;
Core::Id devType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit());
Core::Id devType = ProjectExplorer::DeviceTypeKitAspect::deviceTypeId(target()->kit());
if (devType == Constants::IOS_DEVICE_TYPE && !m_signingIdentifier.isEmpty()) {
if (m_autoManagedSigning) {
extraArgs << qmakeIosTeamSettings + m_signingIdentifier;

View File

@@ -76,7 +76,7 @@ bool IosBuildStep::init()
if (!bc)
emit addTask(Task::buildConfigurationMissingTask());
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID);
ToolChain *tc = ToolChainKitAspect::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID);
if (!tc)
emit addTask(Task::compilerMissingTask());
@@ -138,7 +138,7 @@ QStringList IosBuildStep::defaultArguments() const
{
QStringList res;
Kit *kit = target()->kit();
ToolChain *tc = ToolChainKitInformation::toolChain(kit, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
ToolChain *tc = ToolChainKitAspect::toolChain(kit, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
switch (buildConfiguration()->buildType()) {
case BuildConfiguration::Debug :
res << "-configuration" << "Debug";
@@ -158,8 +158,8 @@ QStringList IosBuildStep::defaultArguments() const
auto gtc = static_cast<GccToolChain *>(tc);
res << gtc->platformCodeGenFlags();
}
if (!SysRootKitInformation::sysRoot(kit).isEmpty())
res << "-sdk" << SysRootKitInformation::sysRoot(kit).toString();
if (!SysRootKitAspect::sysRoot(kit).isEmpty())
res << "-sdk" << SysRootKitAspect::sysRoot(kit).toString();
res << "SYMROOT=" + buildConfiguration()->buildDirectory().toString();
return res;
}

View File

@@ -168,7 +168,7 @@ static QHash<XcodePlatform::ToolchainTarget, ToolChainPair> findToolChains(const
static QSet<Kit *> existingAutoDetectedIosKits()
{
return Utils::filtered(KitManager::kits(), [](Kit *kit) -> bool {
Core::Id deviceKind = DeviceTypeKitInformation::deviceTypeId(kit);
Core::Id deviceKind = DeviceTypeKitAspect::deviceTypeId(kit);
return kit->isAutoDetected() && (deviceKind == Constants::IOS_DEVICE_TYPE
|| deviceKind == Constants::IOS_SIMULATOR_TYPE);
}).toSet();
@@ -183,33 +183,33 @@ static void printKits(const QSet<Kit *> &kits)
static void setupKit(Kit *kit, Core::Id pDeviceType, const ToolChainPair& toolChains,
const QVariant &debuggerId, const Utils::FileName &sdkPath, BaseQtVersion *qtVersion)
{
DeviceTypeKitInformation::setDeviceTypeId(kit, pDeviceType);
DeviceTypeKitAspect::setDeviceTypeId(kit, pDeviceType);
if (toolChains.first)
ToolChainKitInformation::setToolChain(kit, toolChains.first);
ToolChainKitAspect::setToolChain(kit, toolChains.first);
else
ToolChainKitInformation::clearToolChain(kit, ProjectExplorer::Constants::C_LANGUAGE_ID);
ToolChainKitAspect::clearToolChain(kit, ProjectExplorer::Constants::C_LANGUAGE_ID);
if (toolChains.second)
ToolChainKitInformation::setToolChain(kit, toolChains.second);
ToolChainKitAspect::setToolChain(kit, toolChains.second);
else
ToolChainKitInformation::clearToolChain(kit, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
ToolChainKitAspect::clearToolChain(kit, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
QtKitInformation::setQtVersion(kit, qtVersion);
QtKitAspect::setQtVersion(kit, qtVersion);
// only replace debugger with the default one if we find an unusable one here
// (since the user could have changed it)
if ((!DebuggerKitInformation::debugger(kit)
|| !DebuggerKitInformation::debugger(kit)->isValid()
|| DebuggerKitInformation::debugger(kit)->engineType() != LldbEngineType)
if ((!DebuggerKitAspect::debugger(kit)
|| !DebuggerKitAspect::debugger(kit)->isValid()
|| DebuggerKitAspect::debugger(kit)->engineType() != LldbEngineType)
&& debuggerId.isValid())
DebuggerKitInformation::setDebugger(kit, debuggerId);
DebuggerKitAspect::setDebugger(kit, debuggerId);
kit->setMutable(DeviceKitInformation::id(), true);
kit->setSticky(QtKitInformation::id(), true);
kit->setSticky(ToolChainKitInformation::id(), true);
kit->setSticky(DeviceTypeKitInformation::id(), true);
kit->setSticky(SysRootKitInformation::id(), true);
kit->setSticky(DebuggerKitInformation::id(), false);
kit->setMutable(DeviceKitAspect::id(), true);
kit->setSticky(QtKitAspect::id(), true);
kit->setSticky(ToolChainKitAspect::id(), true);
kit->setSticky(DeviceTypeKitAspect::id(), true);
kit->setSticky(SysRootKitAspect::id(), true);
kit->setSticky(DebuggerKitAspect::id(), false);
SysRootKitInformation::setSysRoot(kit, sdkPath);
SysRootKitAspect::setSysRoot(kit, sdkPath);
}
static QVersionNumber findXcodeVersion(const Utils::FileName &developerPath)
@@ -287,10 +287,10 @@ void IosConfigurations::updateAutomaticKitList()
Kit *kit = Utils::findOrDefault(existingKits, [&pDeviceType, &platformToolchains, &qtVersion](const Kit *kit) {
// we do not compare the sdk (thus automatically upgrading it in place if a
// new Xcode is used). Change?
return DeviceTypeKitInformation::deviceTypeId(kit) == pDeviceType
&& ToolChainKitInformation::toolChain(kit, ProjectExplorer::Constants::CXX_LANGUAGE_ID) == platformToolchains.second
&& ToolChainKitInformation::toolChain(kit, ProjectExplorer::Constants::C_LANGUAGE_ID) == platformToolchains.first
&& QtKitInformation::qtVersion(kit) == qtVersion;
return DeviceTypeKitAspect::deviceTypeId(kit) == pDeviceType
&& ToolChainKitAspect::toolChain(kit, ProjectExplorer::Constants::CXX_LANGUAGE_ID) == platformToolchains.second
&& ToolChainKitAspect::toolChain(kit, ProjectExplorer::Constants::C_LANGUAGE_ID) == platformToolchains.first
&& QtKitAspect::qtVersion(kit) == qtVersion;
});
QTC_ASSERT(!resultingKits.contains(kit), continue);
if (kit) {

View File

@@ -73,7 +73,7 @@ Core::Id IosDeployStep::stepId()
void IosDeployStep::updateDisplayNames()
{
IDevice::ConstPtr dev =
DeviceKitInformation::device(target()->kit());
DeviceKitAspect::device(target()->kit());
const QString devName = dev.isNull() ? IosDevice::name() : dev->displayName();
setDefaultDisplayName(tr("Deploy to %1").arg(devName));
setDisplayName(tr("Deploy to %1").arg(devName));
@@ -82,7 +82,7 @@ void IosDeployStep::updateDisplayNames()
bool IosDeployStep::init()
{
QTC_ASSERT(m_transferStatus == NoTransfer, return false);
m_device = DeviceKitInformation::device(target()->kit());
m_device = DeviceKitAspect::device(target()->kit());
auto runConfig = qobject_cast<const IosRunConfiguration *>(
this->target()->activeRunConfiguration());
QTC_ASSERT(runConfig, return false);

View File

@@ -538,11 +538,11 @@ void IosDeviceManager::updateAvailableDevices(const QStringList &devices)
}
}
IosDevice::ConstPtr IosKitInformation::device(Kit *kit)
IosDevice::ConstPtr IosKitAspect::device(Kit *kit)
{
if (!kit)
return IosDevice::ConstPtr();
IDevice::ConstPtr dev = DeviceKitInformation::device(kit);
IDevice::ConstPtr dev = DeviceKitAspect::device(kit);
IosDevice::ConstPtr res = dev.dynamicCast<const IosDevice>();
return res;
}

View File

@@ -103,7 +103,7 @@ private:
QStringList m_userModeDeviceIds;
};
namespace IosKitInformation {
namespace IosKitAspect {
IosDevice::ConstPtr device(ProjectExplorer::Kit *);
}

View File

@@ -125,7 +125,7 @@ void IosDeviceTypeAspect::deviceChanges()
void IosDeviceTypeAspect::updateDeviceType()
{
if (DeviceTypeKitInformation::deviceTypeId(m_runConfiguration->target()->kit())
if (DeviceTypeKitAspect::deviceTypeId(m_runConfiguration->target()->kit())
== Constants::IOS_DEVICE_TYPE)
m_deviceType = IosDeviceType(IosDeviceType::IosDevice);
else if (m_deviceType.type == IosDeviceType::IosDevice)
@@ -134,7 +134,7 @@ void IosDeviceTypeAspect::updateDeviceType()
void IosRunConfiguration::updateDisplayNames()
{
IDevice::ConstPtr dev = DeviceKitInformation::device(target()->kit());
IDevice::ConstPtr dev = DeviceKitAspect::device(target()->kit());
const QString devName = dev.isNull() ? IosDevice::name() : dev->displayName();
setDefaultDisplayName(tr("Run on %1").arg(devName));
setDisplayName(tr("Run %1 on %2").arg(applicationName()).arg(devName));
@@ -144,12 +144,12 @@ void IosRunConfiguration::updateDisplayNames()
void IosRunConfiguration::updateEnabledState()
{
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(target()->kit());
Core::Id devType = DeviceTypeKitAspect::deviceTypeId(target()->kit());
if (devType != Constants::IOS_DEVICE_TYPE && devType != Constants::IOS_SIMULATOR_TYPE) {
setEnabled(false);
return;
}
IDevice::ConstPtr dev = DeviceKitInformation::device(target()->kit());
IDevice::ConstPtr dev = DeviceKitAspect::device(target()->kit());
if (dev.isNull() || dev->deviceState() != IDevice::DeviceReadyToUse) {
setEnabled(false);
return;
@@ -176,7 +176,7 @@ QString IosRunConfiguration::applicationName() const
FileName IosRunConfiguration::bundleDirectory() const
{
FileName res;
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(target()->kit());
Core::Id devType = DeviceTypeKitAspect::deviceTypeId(target()->kit());
bool isDevice = (devType == Constants::IOS_DEVICE_TYPE);
if (!isDevice && devType != Constants::IOS_SIMULATOR_TYPE) {
qCWarning(iosLog) << "unexpected device type in bundleDirForTarget: " << devType.toString();
@@ -238,10 +238,10 @@ void IosDeviceTypeAspect::toMap(QVariantMap &map) const
QString IosRunConfiguration::disabledReason() const
{
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(target()->kit());
Core::Id devType = DeviceTypeKitAspect::deviceTypeId(target()->kit());
if (devType != Constants::IOS_DEVICE_TYPE && devType != Constants::IOS_SIMULATOR_TYPE)
return tr("Kit has incorrect device type for running on iOS devices.");
IDevice::ConstPtr dev = DeviceKitInformation::device(target()->kit());
IDevice::ConstPtr dev = DeviceKitAspect::device(target()->kit());
QString validDevName;
bool hasConncetedDev = false;
if (devType == Constants::IOS_DEVICE_TYPE) {

View File

@@ -81,7 +81,7 @@ static void stopRunningRunControl(RunControl *runControl)
RunConfiguration *runConfig = runControl->runConfiguration();
Target *target = runConfig->target();
Core::Id devId = DeviceKitInformation::deviceId(target->kit());
Core::Id devId = DeviceKitAspect::deviceId(target->kit());
// The device can only run an application at a time, if an app is running stop it.
if (activeRunControls.contains(devId)) {
@@ -101,7 +101,7 @@ IosRunner::IosRunner(RunControl *runControl)
auto runConfig = qobject_cast<IosRunConfiguration *>(runControl->runConfiguration());
m_bundleDir = runConfig->bundleDirectory().toString();
m_arguments = runConfig->aspect<ArgumentsAspect>()->arguments(runConfig->macroExpander());
m_device = DeviceKitInformation::device(runConfig->target()->kit());
m_device = DeviceKitAspect::device(runConfig->target()->kit());
m_deviceType = runConfig->deviceType();
}

View File

@@ -144,7 +144,7 @@ IosSimulator::ConstPtr IosKitInformation::simulator(Kit *kit)
{
if (!kit)
return IosSimulator::ConstPtr();
IDevice::ConstPtr dev = DeviceKitInformation::device(kit);
IDevice::ConstPtr dev = DeviceKitAspect::device(kit);
IosSimulator::ConstPtr res = dev.dynamicCast<const IosSimulator>();
return res;
}