forked from qt-creator/qt-creator
ProjectExplorer: More KitAspect related renamings
Change-Id: I10ad7aacaaf7346f91cadec479f4bba8481b1502 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -66,13 +66,13 @@ static Id defaultCMakeToolId()
|
||||
class CMakeKitAspectImpl final : public KitAspect
|
||||
{
|
||||
public:
|
||||
CMakeKitAspectImpl(Kit *kit, const KitAspectFactory *ki) : KitAspect(kit, ki),
|
||||
CMakeKitAspectImpl(Kit *kit, const KitAspectFactory *factory) : KitAspect(kit, factory),
|
||||
m_comboBox(createSubWidget<QComboBox>()),
|
||||
m_manageButton(createManageButton(Constants::Settings::TOOLS_ID))
|
||||
{
|
||||
m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy());
|
||||
m_comboBox->setEnabled(false);
|
||||
m_comboBox->setToolTip(ki->description());
|
||||
m_comboBox->setToolTip(factory->description());
|
||||
|
||||
refresh();
|
||||
|
||||
@@ -293,8 +293,8 @@ const char TOOLSET_KEY[] = "Toolset";
|
||||
class CMakeGeneratorKitAspectImpl final : public KitAspect
|
||||
{
|
||||
public:
|
||||
CMakeGeneratorKitAspectImpl(Kit *kit, const KitAspectFactory *ki)
|
||||
: KitAspect(kit, ki),
|
||||
CMakeGeneratorKitAspectImpl(Kit *kit, const KitAspectFactory *factory)
|
||||
: KitAspect(kit, factory),
|
||||
m_label(createSubWidget<ElidingLabel>()),
|
||||
m_changeButton(createSubWidget<QPushButton>())
|
||||
{
|
||||
@@ -303,7 +303,7 @@ public:
|
||||
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-generators.7.html");
|
||||
});
|
||||
|
||||
m_label->setToolTip(ki->description());
|
||||
m_label->setToolTip(factory->description());
|
||||
m_changeButton->setText(Tr::tr("Change..."));
|
||||
refresh();
|
||||
connect(m_changeButton, &QPushButton::clicked,
|
||||
@@ -847,8 +847,8 @@ const char QTC_CMAKE_PRESET_KEY[] = "QTC_CMAKE_PRESET";
|
||||
class CMakeConfigurationKitAspectWidget final : public KitAspect
|
||||
{
|
||||
public:
|
||||
CMakeConfigurationKitAspectWidget(Kit *kit, const KitAspectFactory *ki)
|
||||
: KitAspect(kit, ki),
|
||||
CMakeConfigurationKitAspectWidget(Kit *kit, const KitAspectFactory *factory)
|
||||
: KitAspect(kit, factory),
|
||||
m_summaryLabel(createSubWidget<ElidingLabel>()),
|
||||
m_manageButton(createSubWidget<QPushButton>())
|
||||
{
|
||||
|
@@ -38,15 +38,15 @@ namespace Internal {
|
||||
class DebuggerKitAspectImpl final : public KitAspect
|
||||
{
|
||||
public:
|
||||
DebuggerKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki)
|
||||
: KitAspect(workingCopy, ki)
|
||||
DebuggerKitAspectImpl(Kit *workingCopy, const KitAspectFactory *factory)
|
||||
: KitAspect(workingCopy, factory)
|
||||
{
|
||||
m_comboBox = createSubWidget<QComboBox>();
|
||||
m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy());
|
||||
m_comboBox->setEnabled(true);
|
||||
|
||||
refresh();
|
||||
m_comboBox->setToolTip(ki->description());
|
||||
m_comboBox->setToolTip(factory->description());
|
||||
connect(m_comboBox, &QComboBox::currentIndexChanged, this, [this] {
|
||||
if (m_ignoreChanges.isLocked())
|
||||
return;
|
||||
|
@@ -16,8 +16,8 @@ namespace {
|
||||
class McuDependenciesKitAspectImpl final : public KitAspect
|
||||
{
|
||||
public:
|
||||
McuDependenciesKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki)
|
||||
: KitAspect(workingCopy, ki)
|
||||
McuDependenciesKitAspectImpl(Kit *workingCopy, const KitAspectFactory *factory)
|
||||
: KitAspect(workingCopy, factory)
|
||||
{}
|
||||
|
||||
void makeReadOnly() override {}
|
||||
|
@@ -13,9 +13,9 @@ namespace MesonProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
ToolKitAspectWidget::ToolKitAspectWidget(ProjectExplorer::Kit *kit,
|
||||
const ProjectExplorer::KitAspectFactory *ki,
|
||||
const ProjectExplorer::KitAspectFactory *factory,
|
||||
ToolType type)
|
||||
: ProjectExplorer::KitAspect(kit, ki)
|
||||
: ProjectExplorer::KitAspect(kit, factory)
|
||||
, m_toolsComboBox(createSubWidget<QComboBox>())
|
||||
, m_manageButton(createManageButton(Constants::SettingsPage::TOOLS_ID))
|
||||
, m_type{type}
|
||||
@@ -23,7 +23,7 @@ ToolKitAspectWidget::ToolKitAspectWidget(ProjectExplorer::Kit *kit,
|
||||
m_toolsComboBox->setSizePolicy(QSizePolicy::Ignored,
|
||||
m_toolsComboBox->sizePolicy().verticalPolicy());
|
||||
m_toolsComboBox->setEnabled(false);
|
||||
m_toolsComboBox->setToolTip(ki->description());
|
||||
m_toolsComboBox->setToolTip(factory->description());
|
||||
loadTools();
|
||||
|
||||
connect(MesonTools::instance(), &MesonTools::toolAdded,
|
||||
|
@@ -21,7 +21,7 @@ public:
|
||||
enum class ToolType { Meson, Ninja };
|
||||
|
||||
ToolKitAspectWidget(ProjectExplorer::Kit *kit,
|
||||
const ProjectExplorer::KitAspectFactory *ki,
|
||||
const ProjectExplorer::KitAspectFactory *factory,
|
||||
ToolType type);
|
||||
~ToolKitAspectWidget();
|
||||
|
||||
|
@@ -49,7 +49,7 @@ namespace Internal {
|
||||
class SysRootKitAspectImpl : public KitAspect
|
||||
{
|
||||
public:
|
||||
SysRootKitAspectImpl(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki)
|
||||
SysRootKitAspectImpl(Kit *k, const KitAspectFactory *factory) : KitAspect(k, factory)
|
||||
{
|
||||
m_chooser = createSubWidget<PathChooser>();
|
||||
m_chooser->setExpectedKind(PathChooser::ExistingDirectory);
|
||||
@@ -200,7 +200,7 @@ namespace Internal {
|
||||
class ToolChainKitAspectImpl final : public KitAspect
|
||||
{
|
||||
public:
|
||||
ToolChainKitAspectImpl(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki)
|
||||
ToolChainKitAspectImpl(Kit *k, const KitAspectFactory *factory) : KitAspect(k, factory)
|
||||
{
|
||||
m_mainWidget = createSubWidget<QWidget>();
|
||||
m_mainWidget->setContentsMargins(0, 0, 0, 0);
|
||||
@@ -219,7 +219,7 @@ public:
|
||||
layout->addWidget(new QLabel(ToolChainManager::displayNameOfLanguageId(l) + ':'), row, 0);
|
||||
auto cb = new QComboBox;
|
||||
cb->setSizePolicy(QSizePolicy::Ignored, cb->sizePolicy().verticalPolicy());
|
||||
cb->setToolTip(ki->description());
|
||||
cb->setToolTip(factory->description());
|
||||
|
||||
m_languageComboboxMap.insert(l, cb);
|
||||
layout->addWidget(cb, row, 1);
|
||||
@@ -802,12 +802,12 @@ namespace Internal {
|
||||
class DeviceTypeKitAspectImpl final : public KitAspect
|
||||
{
|
||||
public:
|
||||
DeviceTypeKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki)
|
||||
: KitAspect(workingCopy, ki), m_comboBox(createSubWidget<QComboBox>())
|
||||
DeviceTypeKitAspectImpl(Kit *workingCopy, const KitAspectFactory *factory)
|
||||
: KitAspect(workingCopy, factory), m_comboBox(createSubWidget<QComboBox>())
|
||||
{
|
||||
for (IDeviceFactory *factory : IDeviceFactory::allDeviceFactories())
|
||||
m_comboBox->addItem(factory->displayName(), factory->deviceType().toSetting());
|
||||
m_comboBox->setToolTip(ki->description());
|
||||
m_comboBox->setToolTip(factory->description());
|
||||
refresh();
|
||||
connect(m_comboBox, &QComboBox::currentIndexChanged,
|
||||
this, &DeviceTypeKitAspectImpl::currentTypeChanged);
|
||||
@@ -937,8 +937,8 @@ namespace Internal {
|
||||
class DeviceKitAspectImpl final : public KitAspect
|
||||
{
|
||||
public:
|
||||
DeviceKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki)
|
||||
: KitAspect(workingCopy, ki),
|
||||
DeviceKitAspectImpl(Kit *workingCopy, const KitAspectFactory *factory)
|
||||
: KitAspect(workingCopy, factory),
|
||||
m_comboBox(createSubWidget<QComboBox>()),
|
||||
m_model(new DeviceManagerModel(DeviceManager::instance()))
|
||||
{
|
||||
@@ -948,7 +948,7 @@ public:
|
||||
m_comboBox->setMinimumContentsLength(16); // Don't stretch too much for Kit Page
|
||||
m_manageButton = createManageButton(Constants::DEVICE_SETTINGS_PAGE_ID);
|
||||
refresh();
|
||||
m_comboBox->setToolTip(ki->description());
|
||||
m_comboBox->setToolTip(factory->description());
|
||||
|
||||
connect(m_model, &QAbstractItemModel::modelAboutToBeReset,
|
||||
this, &DeviceKitAspectImpl::modelAboutToReset);
|
||||
@@ -1228,8 +1228,8 @@ namespace Internal {
|
||||
class BuildDeviceKitAspectImpl final : public KitAspect
|
||||
{
|
||||
public:
|
||||
BuildDeviceKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki)
|
||||
: KitAspect(workingCopy, ki),
|
||||
BuildDeviceKitAspectImpl(Kit *workingCopy, const KitAspectFactory *factory)
|
||||
: KitAspect(workingCopy, factory),
|
||||
m_comboBox(createSubWidget<QComboBox>()),
|
||||
m_model(new DeviceManagerModel(DeviceManager::instance()))
|
||||
{
|
||||
@@ -1237,7 +1237,7 @@ public:
|
||||
m_comboBox->setModel(m_model);
|
||||
m_manageButton = createManageButton(Constants::DEVICE_SETTINGS_PAGE_ID);
|
||||
refresh();
|
||||
m_comboBox->setToolTip(ki->description());
|
||||
m_comboBox->setToolTip(factory->description());
|
||||
|
||||
connect(m_model, &QAbstractItemModel::modelAboutToBeReset,
|
||||
this, &BuildDeviceKitAspectImpl::modelAboutToReset);
|
||||
@@ -1506,8 +1506,8 @@ namespace Internal {
|
||||
class EnvironmentKitAspectImpl final : public KitAspect
|
||||
{
|
||||
public:
|
||||
EnvironmentKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki)
|
||||
: KitAspect(workingCopy, ki),
|
||||
EnvironmentKitAspectImpl(Kit *workingCopy, const KitAspectFactory *factory)
|
||||
: KitAspect(workingCopy, factory),
|
||||
m_summaryLabel(createSubWidget<ElidingLabel>()),
|
||||
m_manageButton(createSubWidget<QPushButton>()),
|
||||
m_mainWidget(createSubWidget<QWidget>())
|
||||
|
@@ -116,7 +116,7 @@ public:
|
||||
static QString msgManage();
|
||||
|
||||
Kit *kit() const { return m_kit; }
|
||||
const KitAspectFactory *kitInformation() const { return m_factory; }
|
||||
const KitAspectFactory *factory() const { return m_factory; }
|
||||
QAction *mutableAction() const { return m_mutableAction; }
|
||||
void addMutableAction(QWidget *child);
|
||||
QWidget *createManageButton(Utils::Id pageId);
|
||||
|
@@ -210,21 +210,19 @@ void KitManagerConfigWidget::addAspectToWorkingCopy(Layouting::LayoutItem &paren
|
||||
|
||||
void KitManagerConfigWidget::updateVisibility()
|
||||
{
|
||||
int count = m_kitAspects.count();
|
||||
for (int i = 0; i < count; ++i) {
|
||||
KitAspect *aspect = m_kitAspects.at(i);
|
||||
const KitAspectFactory *ki = aspect->kitInformation();
|
||||
const bool visibleInKit = ki->isApplicableToKit(m_modifiedKit.get());
|
||||
const bool irrelevant = m_modifiedKit->irrelevantAspects().contains(ki->id());
|
||||
for (KitAspect *aspect : std::as_const(m_kitAspects)) {
|
||||
const KitAspectFactory *factory = aspect->factory();
|
||||
const bool visibleInKit = factory->isApplicableToKit(m_modifiedKit.get());
|
||||
const bool irrelevant = m_modifiedKit->irrelevantAspects().contains(factory->id());
|
||||
aspect->setVisible(visibleInKit && !irrelevant);
|
||||
}
|
||||
}
|
||||
|
||||
void KitManagerConfigWidget::makeStickySubWidgetsReadOnly()
|
||||
{
|
||||
for (KitAspect *w : std::as_const(m_kitAspects)) {
|
||||
if (w->kit()->isSticky(w->kitInformation()->id()))
|
||||
w->makeReadOnly();
|
||||
for (KitAspect *aspect : std::as_const(m_kitAspects)) {
|
||||
if (aspect->kit()->isSticky(aspect->factory()->id()))
|
||||
aspect->makeReadOnly();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -49,8 +49,7 @@
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
namespace ProjectExplorer::Internal {
|
||||
|
||||
const int RunColumnWidth = 30;
|
||||
|
||||
@@ -565,9 +564,9 @@ int SelectorView::padding()
|
||||
/////////
|
||||
// KitAreaWidget
|
||||
/////////
|
||||
void doLayout(KitAspect *widget, Layouting::LayoutItem &builder)
|
||||
void doLayout(KitAspect *aspect, Layouting::LayoutItem &builder)
|
||||
{
|
||||
widget->addToLayout(builder);
|
||||
aspect->addToLayout(builder);
|
||||
}
|
||||
|
||||
class KitAreaWidget : public QWidget
|
||||
@@ -584,8 +583,8 @@ public:
|
||||
|
||||
void setKit(Kit *k)
|
||||
{
|
||||
qDeleteAll(m_widgets);
|
||||
m_widgets.clear();
|
||||
qDeleteAll(m_kitAspects);
|
||||
m_kitAspects.clear();
|
||||
|
||||
if (!k)
|
||||
return;
|
||||
@@ -595,9 +594,9 @@ public:
|
||||
Layouting::Grid grid;
|
||||
for (KitAspectFactory *factory : KitManager::kitAspectFactories()) {
|
||||
if (k && k->isMutable(factory->id())) {
|
||||
KitAspect *widget = factory->createKitAspect(k);
|
||||
m_widgets << widget;
|
||||
grid.addItems({factory->displayName(), widget, Layouting::br});
|
||||
KitAspect *aspect = factory->createKitAspect(k);
|
||||
m_kitAspects << aspect;
|
||||
grid.addItems({factory->displayName(), aspect, Layouting::br});
|
||||
}
|
||||
}
|
||||
grid.attachTo(this);
|
||||
@@ -605,7 +604,7 @@ public:
|
||||
|
||||
m_kit = k;
|
||||
|
||||
setHidden(m_widgets.isEmpty());
|
||||
setHidden(m_kitAspects.isEmpty());
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -616,7 +615,7 @@ private:
|
||||
|
||||
bool addedMutables = false;
|
||||
QList<const KitAspectFactory *> knownList
|
||||
= Utils::transform(m_widgets, &KitAspect::kitInformation);
|
||||
= Utils::transform(m_kitAspects, &KitAspect::factory);
|
||||
|
||||
for (KitAspectFactory *factory : KitManager::kitAspectFactories()) {
|
||||
const Utils::Id currentId = factory->id();
|
||||
@@ -632,13 +631,13 @@ private:
|
||||
setKit(m_kit);
|
||||
} else {
|
||||
// Refresh all widgets if the number of mutable settings did not change
|
||||
for (KitAspect *w : std::as_const(m_widgets))
|
||||
for (KitAspect *w : std::as_const(m_kitAspects))
|
||||
w->refresh();
|
||||
}
|
||||
}
|
||||
|
||||
Kit *m_kit = nullptr;
|
||||
QList<KitAspect *> m_widgets;
|
||||
QList<KitAspect *> m_kitAspects;
|
||||
};
|
||||
|
||||
/////////
|
||||
@@ -1592,7 +1591,6 @@ void MiniProjectTargetSelector::switchToProjectsMode()
|
||||
hide();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ProjectExplorer
|
||||
} // ProjectExplorer::Internal
|
||||
|
||||
#include <miniprojecttargetselector.moc>
|
||||
|
Reference in New Issue
Block a user