forked from qt-creator/qt-creator
ProjectExplorer: Rename KitAspect related classes
KitAspect -> KitAspectFactory KitAspectWidget -> KitAspect KitAspect::createConfigWidget() -> KitAspectFactory::createKitAspect() Possibly not perfect yet, but closer to what it does and is. There will be follow-ups to rename derived classes. Change-Id: I226f6f025f1e6462c348b68663f776f5a2e8c42d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -651,13 +651,13 @@ void CMakeBuildSettingsWidget::kitCMakeConfiguration()
|
|||||||
CMakeConfigurationKitAspect configurationKitAspect;
|
CMakeConfigurationKitAspect configurationKitAspect;
|
||||||
|
|
||||||
Layouting::Grid grid;
|
Layouting::Grid grid;
|
||||||
KitAspectWidget *widget = kitAspect.createConfigWidget(m_buildConfig->kit());
|
KitAspect *widget = kitAspect.createKitAspect(m_buildConfig->kit());
|
||||||
widget->setParent(dialog);
|
widget->setParent(dialog);
|
||||||
widget->addToLayoutWithLabel(grid, dialog);
|
widget->addToLayoutWithLabel(grid, dialog);
|
||||||
widget = generatorAspect.createConfigWidget(m_buildConfig->kit());
|
widget = generatorAspect.createKitAspect(m_buildConfig->kit());
|
||||||
widget->setParent(dialog);
|
widget->setParent(dialog);
|
||||||
widget->addToLayoutWithLabel(grid, dialog);
|
widget->addToLayoutWithLabel(grid, dialog);
|
||||||
widget = configurationKitAspect.createConfigWidget(m_buildConfig->kit());
|
widget = configurationKitAspect.createKitAspect(m_buildConfig->kit());
|
||||||
widget->setParent(dialog);
|
widget->setParent(dialog);
|
||||||
widget->addToLayoutWithLabel(grid, dialog);
|
widget->addToLayoutWithLabel(grid, dialog);
|
||||||
grid.attachTo(dialog);
|
grid.attachTo(dialog);
|
||||||
|
|||||||
@@ -63,10 +63,10 @@ static Id defaultCMakeToolId()
|
|||||||
return defaultTool ? defaultTool->id() : Id();
|
return defaultTool ? defaultTool->id() : Id();
|
||||||
}
|
}
|
||||||
|
|
||||||
class CMakeKitAspectWidget final : public KitAspectWidget
|
class CMakeKitAspectWidget final : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CMakeKitAspectWidget(Kit *kit, const KitAspect *ki) : KitAspectWidget(kit, ki),
|
CMakeKitAspectWidget(Kit *kit, const KitAspectFactory *ki) : KitAspect(kit, ki),
|
||||||
m_comboBox(createSubWidget<QComboBox>()),
|
m_comboBox(createSubWidget<QComboBox>()),
|
||||||
m_manageButton(createManageButton(Constants::Settings::TOOLS_ID))
|
m_manageButton(createManageButton(Constants::Settings::TOOLS_ID))
|
||||||
{
|
{
|
||||||
@@ -242,13 +242,13 @@ void CMakeKitAspect::fix(Kit *k)
|
|||||||
setup(k);
|
setup(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect::ItemList CMakeKitAspect::toUserOutput(const Kit *k) const
|
KitAspectFactory::ItemList CMakeKitAspect::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
const CMakeTool *const tool = cmakeTool(k);
|
const CMakeTool *const tool = cmakeTool(k);
|
||||||
return {{Tr::tr("CMake"), tool ? tool->displayName() : Tr::tr("Unconfigured")}};
|
return {{Tr::tr("CMake"), tool ? tool->displayName() : Tr::tr("Unconfigured")}};
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget *CMakeKitAspect::createConfigWidget(Kit *k) const
|
KitAspect *CMakeKitAspect::createKitAspect(Kit *k) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(k, return nullptr);
|
QTC_ASSERT(k, return nullptr);
|
||||||
return new CMakeKitAspectWidget(k, this);
|
return new CMakeKitAspectWidget(k, this);
|
||||||
@@ -289,16 +289,16 @@ const char EXTRA_GENERATOR_KEY[] = "ExtraGenerator";
|
|||||||
const char PLATFORM_KEY[] = "Platform";
|
const char PLATFORM_KEY[] = "Platform";
|
||||||
const char TOOLSET_KEY[] = "Toolset";
|
const char TOOLSET_KEY[] = "Toolset";
|
||||||
|
|
||||||
class CMakeGeneratorKitAspectWidget final : public KitAspectWidget
|
class CMakeGeneratorKitAspectWidget final : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CMakeGeneratorKitAspectWidget(Kit *kit, const KitAspect *ki)
|
CMakeGeneratorKitAspectWidget(Kit *kit, const KitAspectFactory *ki)
|
||||||
: KitAspectWidget(kit, ki),
|
: KitAspect(kit, ki),
|
||||||
m_label(createSubWidget<ElidingLabel>()),
|
m_label(createSubWidget<ElidingLabel>()),
|
||||||
m_changeButton(createSubWidget<QPushButton>())
|
m_changeButton(createSubWidget<QPushButton>())
|
||||||
{
|
{
|
||||||
const CMakeTool *tool = CMakeKitAspect::cmakeTool(kit);
|
const CMakeTool *tool = CMakeKitAspect::cmakeTool(kit);
|
||||||
connect(this, &KitAspectWidget::labelLinkActivated, this, [=](const QString &) {
|
connect(this, &KitAspect::labelLinkActivated, this, [=](const QString &) {
|
||||||
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-generators.7.html");
|
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-generators.7.html");
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -798,7 +798,7 @@ void CMakeGeneratorKitAspect::upgrade(Kit *k)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect::ItemList CMakeGeneratorKitAspect::toUserOutput(const Kit *k) const
|
KitAspectFactory::ItemList CMakeGeneratorKitAspect::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
const GeneratorInfo info = generatorInfo(k);
|
const GeneratorInfo info = generatorInfo(k);
|
||||||
QString message;
|
QString message;
|
||||||
@@ -814,7 +814,7 @@ KitAspect::ItemList CMakeGeneratorKitAspect::toUserOutput(const Kit *k) const
|
|||||||
return {{Tr::tr("CMake Generator"), message}};
|
return {{Tr::tr("CMake Generator"), message}};
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget *CMakeGeneratorKitAspect::createConfigWidget(Kit *k) const
|
KitAspect *CMakeGeneratorKitAspect::createKitAspect(Kit *k) const
|
||||||
{
|
{
|
||||||
return new CMakeGeneratorKitAspectWidget(k, this);
|
return new CMakeGeneratorKitAspectWidget(k, this);
|
||||||
}
|
}
|
||||||
@@ -843,11 +843,11 @@ const char CMAKE_QMAKE_KEY[] = "QT_QMAKE_EXECUTABLE";
|
|||||||
const char CMAKE_PREFIX_PATH_KEY[] = "CMAKE_PREFIX_PATH";
|
const char CMAKE_PREFIX_PATH_KEY[] = "CMAKE_PREFIX_PATH";
|
||||||
const char QTC_CMAKE_PRESET_KEY[] = "QTC_CMAKE_PRESET";
|
const char QTC_CMAKE_PRESET_KEY[] = "QTC_CMAKE_PRESET";
|
||||||
|
|
||||||
class CMakeConfigurationKitAspectWidget final : public KitAspectWidget
|
class CMakeConfigurationKitAspectWidget final : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CMakeConfigurationKitAspectWidget(Kit *kit, const KitAspect *ki)
|
CMakeConfigurationKitAspectWidget(Kit *kit, const KitAspectFactory *ki)
|
||||||
: KitAspectWidget(kit, ki),
|
: KitAspect(kit, ki),
|
||||||
m_summaryLabel(createSubWidget<ElidingLabel>()),
|
m_summaryLabel(createSubWidget<ElidingLabel>()),
|
||||||
m_manageButton(createSubWidget<QPushButton>())
|
m_manageButton(createSubWidget<QPushButton>())
|
||||||
{
|
{
|
||||||
@@ -1217,12 +1217,12 @@ void CMakeConfigurationKitAspect::fix(Kit *k)
|
|||||||
Q_UNUSED(k)
|
Q_UNUSED(k)
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect::ItemList CMakeConfigurationKitAspect::toUserOutput(const Kit *k) const
|
KitAspectFactory::ItemList CMakeConfigurationKitAspect::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
return {{Tr::tr("CMake Configuration"), toStringList(k).join("<br>")}};
|
return {{Tr::tr("CMake Configuration"), toStringList(k).join("<br>")}};
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget *CMakeConfigurationKitAspect::createConfigWidget(Kit *k) const
|
KitAspect *CMakeConfigurationKitAspect::createKitAspect(Kit *k) const
|
||||||
{
|
{
|
||||||
if (!k)
|
if (!k)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace CMakeProjectManager {
|
|||||||
|
|
||||||
class CMakeTool;
|
class CMakeTool;
|
||||||
|
|
||||||
class CMAKE_EXPORT CMakeKitAspect : public ProjectExplorer::KitAspect
|
class CMAKE_EXPORT CMakeKitAspect : public ProjectExplorer::KitAspectFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CMakeKitAspect();
|
CMakeKitAspect();
|
||||||
@@ -29,7 +29,7 @@ public:
|
|||||||
void setup(ProjectExplorer::Kit *k) final;
|
void setup(ProjectExplorer::Kit *k) final;
|
||||||
void fix(ProjectExplorer::Kit *k) final;
|
void fix(ProjectExplorer::Kit *k) final;
|
||||||
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
||||||
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const final;
|
ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const final;
|
||||||
|
|
||||||
void addToMacroExpander(ProjectExplorer::Kit *k, Utils::MacroExpander *expander) const final;
|
void addToMacroExpander(ProjectExplorer::Kit *k, Utils::MacroExpander *expander) const final;
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ public:
|
|||||||
static QString msgUnsupportedVersion(const QByteArray &versionString);
|
static QString msgUnsupportedVersion(const QByteArray &versionString);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CMAKE_EXPORT CMakeGeneratorKitAspect : public ProjectExplorer::KitAspect
|
class CMAKE_EXPORT CMakeGeneratorKitAspect : public ProjectExplorer::KitAspectFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CMakeGeneratorKitAspect();
|
CMakeGeneratorKitAspect();
|
||||||
@@ -63,14 +63,14 @@ public:
|
|||||||
void fix(ProjectExplorer::Kit *k) final;
|
void fix(ProjectExplorer::Kit *k) final;
|
||||||
void upgrade(ProjectExplorer::Kit *k) final;
|
void upgrade(ProjectExplorer::Kit *k) final;
|
||||||
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
||||||
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const final;
|
ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const final;
|
||||||
void addToBuildEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const final;
|
void addToBuildEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVariant defaultValue(const ProjectExplorer::Kit *k) const;
|
QVariant defaultValue(const ProjectExplorer::Kit *k) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CMAKE_EXPORT CMakeConfigurationKitAspect : public ProjectExplorer::KitAspect
|
class CMAKE_EXPORT CMakeConfigurationKitAspect : public ProjectExplorer::KitAspectFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CMakeConfigurationKitAspect();
|
CMakeConfigurationKitAspect();
|
||||||
@@ -96,7 +96,7 @@ public:
|
|||||||
void setup(ProjectExplorer::Kit *k) final;
|
void setup(ProjectExplorer::Kit *k) final;
|
||||||
void fix(ProjectExplorer::Kit *k) final;
|
void fix(ProjectExplorer::Kit *k) final;
|
||||||
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
||||||
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const final;
|
ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVariant defaultValue(const ProjectExplorer::Kit *k) const;
|
QVariant defaultValue(const ProjectExplorer::Kit *k) const;
|
||||||
|
|||||||
@@ -35,11 +35,11 @@ namespace Debugger {
|
|||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class DebuggerKitAspectWidget final : public KitAspectWidget
|
class DebuggerKitAspectWidget final : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DebuggerKitAspectWidget(Kit *workingCopy, const KitAspect *ki)
|
DebuggerKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki)
|
||||||
: KitAspectWidget(workingCopy, ki)
|
: KitAspect(workingCopy, ki)
|
||||||
{
|
{
|
||||||
m_comboBox = createSubWidget<QComboBox>();
|
m_comboBox = createSubWidget<QComboBox>();
|
||||||
m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy());
|
m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy());
|
||||||
@@ -348,7 +348,7 @@ Tasks DebuggerKitAspect::validateDebugger(const Kit *k)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget *DebuggerKitAspect::createConfigWidget(Kit *k) const
|
KitAspect *DebuggerKitAspect::createKitAspect(Kit *k) const
|
||||||
{
|
{
|
||||||
return new Internal::DebuggerKitAspectWidget(k, this);
|
return new Internal::DebuggerKitAspectWidget(k, this);
|
||||||
}
|
}
|
||||||
@@ -384,7 +384,7 @@ void DebuggerKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) co
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect::ItemList DebuggerKitAspect::toUserOutput(const Kit *k) const
|
KitAspectFactory::ItemList DebuggerKitAspect::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
return {{Tr::tr("Debugger"), displayString(k)}};
|
return {{Tr::tr("Debugger"), displayString(k)}};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
class DebuggerItem;
|
class DebuggerItem;
|
||||||
|
|
||||||
class DEBUGGER_EXPORT DebuggerKitAspect : public ProjectExplorer::KitAspect
|
class DEBUGGER_EXPORT DebuggerKitAspect : public ProjectExplorer::KitAspectFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DebuggerKitAspect();
|
DebuggerKitAspect();
|
||||||
@@ -39,7 +39,7 @@ public:
|
|||||||
static ProjectExplorer::Tasks validateDebugger(const ProjectExplorer::Kit *k);
|
static ProjectExplorer::Tasks validateDebugger(const ProjectExplorer::Kit *k);
|
||||||
static ConfigurationErrors configurationErrors(const ProjectExplorer::Kit *k);
|
static ConfigurationErrors configurationErrors(const ProjectExplorer::Kit *k);
|
||||||
|
|
||||||
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const override;
|
ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const override;
|
||||||
void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override;
|
void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override;
|
||||||
|
|
||||||
ItemList toUserOutput(const ProjectExplorer::Kit *k) const override;
|
ItemList toUserOutput(const ProjectExplorer::Kit *k) const override;
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ using namespace ProjectExplorer;
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class McuDependenciesKitAspectWidget final : public KitAspectWidget
|
class McuDependenciesKitAspectWidget final : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
McuDependenciesKitAspectWidget(Kit *workingCopy, const KitAspect *ki)
|
McuDependenciesKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki)
|
||||||
: KitAspectWidget(workingCopy, ki)
|
: KitAspect(workingCopy, ki)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void makeReadOnly() override {}
|
void makeReadOnly() override {}
|
||||||
@@ -83,13 +83,13 @@ void McuDependenciesKitAspect::fix(Kit *kit)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget *McuDependenciesKitAspect::createConfigWidget(Kit *kit) const
|
KitAspect *McuDependenciesKitAspect::createKitAspect(Kit *kit) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(kit, return nullptr);
|
QTC_ASSERT(kit, return nullptr);
|
||||||
return new McuDependenciesKitAspectWidget(kit, this);
|
return new McuDependenciesKitAspectWidget(kit, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect::ItemList McuDependenciesKitAspect::toUserOutput(const Kit *kit) const
|
KitAspectFactory::ItemList McuDependenciesKitAspect::toUserOutput(const Kit *kit) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(kit)
|
Q_UNUSED(kit)
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
namespace McuSupport {
|
namespace McuSupport {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class McuDependenciesKitAspect final : public ProjectExplorer::KitAspect
|
class McuDependenciesKitAspect final : public ProjectExplorer::KitAspectFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ public:
|
|||||||
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *kit) const override;
|
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *kit) const override;
|
||||||
void fix(ProjectExplorer::Kit *kit) override;
|
void fix(ProjectExplorer::Kit *kit) override;
|
||||||
|
|
||||||
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *kit) const override;
|
ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *kit) const override;
|
||||||
|
|
||||||
ItemList toUserOutput(const ProjectExplorer::Kit *kit) const override;
|
ItemList toUserOutput(const ProjectExplorer::Kit *kit) const override;
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ void MesonToolKitAspect::fix(ProjectExplorer::Kit *k)
|
|||||||
setup(k);
|
setup(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::KitAspect::ItemList MesonToolKitAspect::toUserOutput(
|
ProjectExplorer::KitAspectFactory::ItemList MesonToolKitAspect::toUserOutput(
|
||||||
const ProjectExplorer::Kit *k) const
|
const ProjectExplorer::Kit *k) const
|
||||||
{
|
{
|
||||||
const auto tool = mesonTool(k);
|
const auto tool = mesonTool(k);
|
||||||
@@ -57,7 +57,7 @@ ProjectExplorer::KitAspect::ItemList MesonToolKitAspect::toUserOutput(
|
|||||||
return {{Tr::tr("Meson"), Tr::tr("Unconfigured")}};
|
return {{Tr::tr("Meson"), Tr::tr("Unconfigured")}};
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::KitAspectWidget *MesonToolKitAspect::createConfigWidget(ProjectExplorer::Kit *k) const
|
ProjectExplorer::KitAspect *MesonToolKitAspect::createKitAspect(ProjectExplorer::Kit *k) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(k, return nullptr);
|
QTC_ASSERT(k, return nullptr);
|
||||||
return new ToolKitAspectWidget{k, this, ToolKitAspectWidget::ToolType::Meson};
|
return new ToolKitAspectWidget{k, this, ToolKitAspectWidget::ToolType::Meson};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
namespace MesonProjectManager {
|
namespace MesonProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class MesonToolKitAspect final : public ProjectExplorer::KitAspect
|
class MesonToolKitAspect final : public ProjectExplorer::KitAspectFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MesonToolKitAspect();
|
MesonToolKitAspect();
|
||||||
@@ -20,7 +20,7 @@ public:
|
|||||||
void setup(ProjectExplorer::Kit *k) final;
|
void setup(ProjectExplorer::Kit *k) final;
|
||||||
void fix(ProjectExplorer::Kit *k) final;
|
void fix(ProjectExplorer::Kit *k) final;
|
||||||
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
||||||
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *) const final;
|
ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const final;
|
||||||
|
|
||||||
static void setMesonTool(ProjectExplorer::Kit *kit, Utils::Id id);
|
static void setMesonTool(ProjectExplorer::Kit *kit, Utils::Id id);
|
||||||
static Utils::Id mesonToolId(const ProjectExplorer::Kit *kit);
|
static Utils::Id mesonToolId(const ProjectExplorer::Kit *kit);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ void NinjaToolKitAspect::fix(ProjectExplorer::Kit *k)
|
|||||||
setup(k);
|
setup(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::KitAspect::ItemList NinjaToolKitAspect::toUserOutput(
|
ProjectExplorer::KitAspectFactory::ItemList NinjaToolKitAspect::toUserOutput(
|
||||||
const ProjectExplorer::Kit *k) const
|
const ProjectExplorer::Kit *k) const
|
||||||
{
|
{
|
||||||
const auto tool = ninjaTool(k);
|
const auto tool = ninjaTool(k);
|
||||||
@@ -57,7 +57,7 @@ ProjectExplorer::KitAspect::ItemList NinjaToolKitAspect::toUserOutput(
|
|||||||
return {{Tr::tr("Ninja"), Tr::tr("Unconfigured")}};
|
return {{Tr::tr("Ninja"), Tr::tr("Unconfigured")}};
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::KitAspectWidget *NinjaToolKitAspect::createConfigWidget(ProjectExplorer::Kit *k) const
|
ProjectExplorer::KitAspect *NinjaToolKitAspect::createKitAspect(ProjectExplorer::Kit *k) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(k, return nullptr);
|
QTC_ASSERT(k, return nullptr);
|
||||||
return new ToolKitAspectWidget{k, this, ToolKitAspectWidget::ToolType::Ninja};
|
return new ToolKitAspectWidget{k, this, ToolKitAspectWidget::ToolType::Ninja};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
namespace MesonProjectManager {
|
namespace MesonProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class NinjaToolKitAspect final : public ProjectExplorer::KitAspect
|
class NinjaToolKitAspect final : public ProjectExplorer::KitAspectFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NinjaToolKitAspect();
|
NinjaToolKitAspect();
|
||||||
@@ -20,7 +20,7 @@ public:
|
|||||||
void setup(ProjectExplorer::Kit *k) final;
|
void setup(ProjectExplorer::Kit *k) final;
|
||||||
void fix(ProjectExplorer::Kit *k) final;
|
void fix(ProjectExplorer::Kit *k) final;
|
||||||
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
||||||
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *) const final;
|
ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const final;
|
||||||
|
|
||||||
static void setNinjaTool(ProjectExplorer::Kit *kit, Utils::Id id);
|
static void setNinjaTool(ProjectExplorer::Kit *kit, Utils::Id id);
|
||||||
static Utils::Id ninjaToolId(const ProjectExplorer::Kit *kit);
|
static Utils::Id ninjaToolId(const ProjectExplorer::Kit *kit);
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ namespace MesonProjectManager {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
ToolKitAspectWidget::ToolKitAspectWidget(ProjectExplorer::Kit *kit,
|
ToolKitAspectWidget::ToolKitAspectWidget(ProjectExplorer::Kit *kit,
|
||||||
const ProjectExplorer::KitAspect *ki,
|
const ProjectExplorer::KitAspectFactory *ki,
|
||||||
ToolType type)
|
ToolType type)
|
||||||
: ProjectExplorer::KitAspectWidget(kit, ki)
|
: ProjectExplorer::KitAspect(kit, ki)
|
||||||
, m_toolsComboBox(createSubWidget<QComboBox>())
|
, m_toolsComboBox(createSubWidget<QComboBox>())
|
||||||
, m_manageButton(createManageButton(Constants::SettingsPage::TOOLS_ID))
|
, m_manageButton(createManageButton(Constants::SettingsPage::TOOLS_ID))
|
||||||
, m_type{type}
|
, m_type{type}
|
||||||
|
|||||||
@@ -15,13 +15,13 @@
|
|||||||
namespace MesonProjectManager {
|
namespace MesonProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class ToolKitAspectWidget final : public ProjectExplorer::KitAspectWidget
|
class ToolKitAspectWidget final : public ProjectExplorer::KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum class ToolType { Meson, Ninja };
|
enum class ToolType { Meson, Ninja };
|
||||||
|
|
||||||
ToolKitAspectWidget(ProjectExplorer::Kit *kit,
|
ToolKitAspectWidget(ProjectExplorer::Kit *kit,
|
||||||
const ProjectExplorer::KitAspect *ki,
|
const ProjectExplorer::KitAspectFactory *ki,
|
||||||
ToolType type);
|
ToolType type);
|
||||||
~ToolKitAspectWidget();
|
~ToolKitAspectWidget();
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Internal {
|
|||||||
class FilterTreeItem : public TreeItem
|
class FilterTreeItem : public TreeItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FilterTreeItem(const KitAspect *aspect, bool enabled) : m_aspect(aspect), m_enabled(enabled)
|
FilterTreeItem(const KitAspectFactory *aspect, bool enabled) : m_aspect(aspect), m_enabled(enabled)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
QString displayName() const {
|
QString displayName() const {
|
||||||
@@ -72,7 +72,7 @@ private:
|
|||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
const KitAspect * const m_aspect;
|
const KitAspectFactory * const m_aspect;
|
||||||
bool m_enabled;
|
bool m_enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ public:
|
|||||||
FilterKitAspectsModel(const Kit *kit, QObject *parent) : TreeModel(parent)
|
FilterKitAspectsModel(const Kit *kit, QObject *parent) : TreeModel(parent)
|
||||||
{
|
{
|
||||||
setHeader({Tr::tr("Setting"), Tr::tr("Visible")});
|
setHeader({Tr::tr("Setting"), Tr::tr("Visible")});
|
||||||
for (const KitAspect * const aspect : KitManager::kitAspects()) {
|
for (const KitAspectFactory * const aspect : KitManager::kitAspects()) {
|
||||||
if (kit && !aspect->isApplicableToKit(kit))
|
if (kit && !aspect->isApplicableToKit(kit))
|
||||||
continue;
|
continue;
|
||||||
const QSet<Utils::Id> irrelevantAspects = kit ? kit->irrelevantAspects()
|
const QSet<Utils::Id> irrelevantAspects = kit ? kit->irrelevantAspects()
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public:
|
|||||||
[kit] { return kit->id().toString(); });
|
[kit] { return kit->id().toString(); });
|
||||||
m_macroExpander.registerVariable("Kit:FileSystemName", Tr::tr("Kit filesystem-friendly name"),
|
m_macroExpander.registerVariable("Kit:FileSystemName", Tr::tr("Kit filesystem-friendly name"),
|
||||||
[kit] { return kit->fileSystemFriendlyName(); });
|
[kit] { return kit->fileSystemFriendlyName(); });
|
||||||
for (KitAspect *aspect : KitManager::kitAspects())
|
for (KitAspectFactory *aspect : KitManager::kitAspects())
|
||||||
aspect->addToMacroExpander(kit, &m_macroExpander);
|
aspect->addToMacroExpander(kit, &m_macroExpander);
|
||||||
|
|
||||||
m_macroExpander.registerVariable("Kit:Name",
|
m_macroExpander.registerVariable("Kit:Name",
|
||||||
@@ -235,7 +235,7 @@ bool Kit::hasWarning() const
|
|||||||
Tasks Kit::validate() const
|
Tasks Kit::validate() const
|
||||||
{
|
{
|
||||||
Tasks result;
|
Tasks result;
|
||||||
for (KitAspect *aspect : KitManager::kitAspects())
|
for (KitAspectFactory *aspect : KitManager::kitAspects())
|
||||||
result.append(aspect->validate(this));
|
result.append(aspect->validate(this));
|
||||||
|
|
||||||
d->m_hasError = containsType(result, Task::TaskType::Error);
|
d->m_hasError = containsType(result, Task::TaskType::Error);
|
||||||
@@ -248,15 +248,15 @@ Tasks Kit::validate() const
|
|||||||
void Kit::fix()
|
void Kit::fix()
|
||||||
{
|
{
|
||||||
KitGuard g(this);
|
KitGuard g(this);
|
||||||
for (KitAspect *aspect : KitManager::kitAspects())
|
for (KitAspectFactory *aspect : KitManager::kitAspects())
|
||||||
aspect->fix(this);
|
aspect->fix(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kit::setup()
|
void Kit::setup()
|
||||||
{
|
{
|
||||||
KitGuard g(this);
|
KitGuard g(this);
|
||||||
const QList<KitAspect *> aspects = KitManager::kitAspects();
|
const QList<KitAspectFactory *> aspects = KitManager::kitAspects();
|
||||||
for (KitAspect * const aspect : aspects)
|
for (KitAspectFactory * const aspect : aspects)
|
||||||
aspect->setup(this);
|
aspect->setup(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,7 +265,7 @@ void Kit::upgrade()
|
|||||||
KitGuard g(this);
|
KitGuard g(this);
|
||||||
// Process the KitAspects in reverse order: They may only be based on other information
|
// Process the KitAspects in reverse order: They may only be based on other information
|
||||||
// lower in the stack.
|
// lower in the stack.
|
||||||
for (KitAspect *aspect : KitManager::kitAspects())
|
for (KitAspectFactory *aspect : KitManager::kitAspects())
|
||||||
aspect->upgrade(this);
|
aspect->upgrade(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,9 +336,9 @@ Id Kit::id() const
|
|||||||
|
|
||||||
int Kit::weight() const
|
int Kit::weight() const
|
||||||
{
|
{
|
||||||
const QList<KitAspect *> &aspects = KitManager::kitAspects();
|
const QList<KitAspectFactory *> &aspects = KitManager::kitAspects();
|
||||||
return std::accumulate(aspects.begin(), aspects.end(), 0,
|
return std::accumulate(aspects.begin(), aspects.end(), 0,
|
||||||
[this](int sum, const KitAspect *aspect) {
|
[this](int sum, const KitAspectFactory *aspect) {
|
||||||
return sum + aspect->weight(this);
|
return sum + aspect->weight(this);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -526,13 +526,13 @@ QVariantMap Kit::toMap() const
|
|||||||
|
|
||||||
void Kit::addToBuildEnvironment(Environment &env) const
|
void Kit::addToBuildEnvironment(Environment &env) const
|
||||||
{
|
{
|
||||||
for (KitAspect *aspect : KitManager::kitAspects())
|
for (KitAspectFactory *aspect : KitManager::kitAspects())
|
||||||
aspect->addToBuildEnvironment(this, env);
|
aspect->addToBuildEnvironment(this, env);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kit::addToRunEnvironment(Environment &env) const
|
void Kit::addToRunEnvironment(Environment &env) const
|
||||||
{
|
{
|
||||||
for (KitAspect *aspect : KitManager::kitAspects())
|
for (KitAspectFactory *aspect : KitManager::kitAspects())
|
||||||
aspect->addToRunEnvironment(this, env);
|
aspect->addToRunEnvironment(this, env);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -555,7 +555,7 @@ Environment Kit::runEnvironment() const
|
|||||||
QList<OutputLineParser *> Kit::createOutputParsers() const
|
QList<OutputLineParser *> Kit::createOutputParsers() const
|
||||||
{
|
{
|
||||||
QList<OutputLineParser *> parsers{new OsParser};
|
QList<OutputLineParser *> parsers{new OsParser};
|
||||||
for (KitAspect *aspect : KitManager::kitAspects())
|
for (KitAspectFactory *aspect : KitManager::kitAspects())
|
||||||
parsers << aspect->createOutputParsers(this);
|
parsers << aspect->createOutputParsers(this);
|
||||||
return parsers;
|
return parsers;
|
||||||
}
|
}
|
||||||
@@ -574,9 +574,9 @@ QString Kit::toHtml(const Tasks &additional, const QString &extraText) const
|
|||||||
str << "<p>" << ProjectExplorer::toHtml(additional + validate()) << "</p>";
|
str << "<p>" << ProjectExplorer::toHtml(additional + validate()) << "</p>";
|
||||||
|
|
||||||
str << "<dl style=\"white-space:pre\">";
|
str << "<dl style=\"white-space:pre\">";
|
||||||
for (KitAspect *aspect : KitManager::kitAspects()) {
|
for (KitAspectFactory *aspect : KitManager::kitAspects()) {
|
||||||
const KitAspect::ItemList list = aspect->toUserOutput(this);
|
const KitAspectFactory::ItemList list = aspect->toUserOutput(this);
|
||||||
for (const KitAspect::Item &j : list) {
|
for (const KitAspectFactory::Item &j : list) {
|
||||||
QString contents = j.second;
|
QString contents = j.second;
|
||||||
if (contents.size() > 256) {
|
if (contents.size() > 256) {
|
||||||
int pos = contents.lastIndexOf("<br>", 256);
|
int pos = contents.lastIndexOf("<br>", 256);
|
||||||
@@ -619,7 +619,7 @@ void Kit::setSdkProvided(bool sdkProvided)
|
|||||||
|
|
||||||
void Kit::makeSticky()
|
void Kit::makeSticky()
|
||||||
{
|
{
|
||||||
for (KitAspect *aspect : KitManager::kitAspects()) {
|
for (KitAspectFactory *aspect : KitManager::kitAspects()) {
|
||||||
if (hasValue(aspect->id()))
|
if (hasValue(aspect->id()))
|
||||||
setSticky(aspect->id(), true);
|
setSticky(aspect->id(), true);
|
||||||
}
|
}
|
||||||
@@ -675,7 +675,7 @@ QSet<Id> Kit::irrelevantAspects() const
|
|||||||
QSet<Id> Kit::supportedPlatforms() const
|
QSet<Id> Kit::supportedPlatforms() const
|
||||||
{
|
{
|
||||||
QSet<Id> platforms;
|
QSet<Id> platforms;
|
||||||
for (const KitAspect *aspect : KitManager::kitAspects()) {
|
for (const KitAspectFactory *aspect : KitManager::kitAspects()) {
|
||||||
const QSet<Id> ip = aspect->supportedPlatforms(this);
|
const QSet<Id> ip = aspect->supportedPlatforms(this);
|
||||||
if (ip.isEmpty())
|
if (ip.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
@@ -690,7 +690,7 @@ QSet<Id> Kit::supportedPlatforms() const
|
|||||||
QSet<Id> Kit::availableFeatures() const
|
QSet<Id> Kit::availableFeatures() const
|
||||||
{
|
{
|
||||||
QSet<Id> features;
|
QSet<Id> features;
|
||||||
for (const KitAspect *aspect : KitManager::kitAspects())
|
for (const KitAspectFactory *aspect : KitManager::kitAspects())
|
||||||
features |= aspect->availableFeatures(this);
|
features |= aspect->availableFeatures(this);
|
||||||
return features;
|
return features;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ private:
|
|||||||
|
|
||||||
const std::unique_ptr<Internal::KitPrivate> d;
|
const std::unique_ptr<Internal::KitPrivate> d;
|
||||||
|
|
||||||
friend class KitAspect;
|
friend class KitAspectFactory;
|
||||||
friend class KitManager;
|
friend class KitManager;
|
||||||
friend class Internal::KitManagerPrivate;
|
friend class Internal::KitManagerPrivate;
|
||||||
friend class Internal::KitModel; // needed for setAutoDetected() when cloning kits
|
friend class Internal::KitModel; // needed for setAutoDetected() when cloning kits
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ KitChooser::KitChooser(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
m_chooser = new QComboBox(this);
|
m_chooser = new QComboBox(this);
|
||||||
m_chooser->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
m_chooser->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
||||||
m_manageButton = new QPushButton(KitAspectWidget::msgManage(), this);
|
m_manageButton = new QPushButton(KitAspect::msgManage(), this);
|
||||||
|
|
||||||
auto layout = new QHBoxLayout(this);
|
auto layout = new QHBoxLayout(this);
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ const char KITINFORMATION_ID_V3[] = "PE.Profile.ToolChainsV3";
|
|||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class SysRootKitAspectWidget : public KitAspectWidget
|
class SysRootKitAspectWidget : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SysRootKitAspectWidget(Kit *k, const KitAspect *ki) : KitAspectWidget(k, ki)
|
SysRootKitAspectWidget(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki)
|
||||||
{
|
{
|
||||||
m_chooser = createSubWidget<PathChooser>();
|
m_chooser = createSubWidget<PathChooser>();
|
||||||
m_chooser->setExpectedKind(PathChooser::ExistingDirectory);
|
m_chooser->setExpectedKind(PathChooser::ExistingDirectory);
|
||||||
@@ -120,14 +120,14 @@ Tasks SysRootKitAspect::validate(const Kit *k) const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget *SysRootKitAspect::createConfigWidget(Kit *k) const
|
KitAspect *SysRootKitAspect::createKitAspect(Kit *k) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(k, return nullptr);
|
QTC_ASSERT(k, return nullptr);
|
||||||
|
|
||||||
return new Internal::SysRootKitAspectWidget(k, this);
|
return new Internal::SysRootKitAspectWidget(k, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect::ItemList SysRootKitAspect::toUserOutput(const Kit *k) const
|
KitAspectFactory::ItemList SysRootKitAspect::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
return {{Tr::tr("Sys Root"), sysRoot(k).toUserOutput()}};
|
return {{Tr::tr("Sys Root"), sysRoot(k).toUserOutput()}};
|
||||||
}
|
}
|
||||||
@@ -184,10 +184,10 @@ void SysRootKitAspect::setSysRoot(Kit *k, const FilePath &v)
|
|||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class ToolChainKitAspectWidget final : public KitAspectWidget
|
class ToolChainKitAspectWidget final : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ToolChainKitAspectWidget(Kit *k, const KitAspect *ki) : KitAspectWidget(k, ki)
|
ToolChainKitAspectWidget(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki)
|
||||||
{
|
{
|
||||||
m_mainWidget = createSubWidget<QWidget>();
|
m_mainWidget = createSubWidget<QWidget>();
|
||||||
m_mainWidget->setContentsMargins(0, 0, 0, 0);
|
m_mainWidget->setContentsMargins(0, 0, 0, 0);
|
||||||
@@ -502,7 +502,7 @@ void ToolChainKitAspect::setup(Kit *k)
|
|||||||
k->setSticky(id(), lockToolchains);
|
k->setSticky(id(), lockToolchains);
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget *ToolChainKitAspect::createConfigWidget(Kit *k) const
|
KitAspect *ToolChainKitAspect::createKitAspect(Kit *k) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(k, return nullptr);
|
QTC_ASSERT(k, return nullptr);
|
||||||
return new Internal::ToolChainKitAspectWidget(k, this);
|
return new Internal::ToolChainKitAspectWidget(k, this);
|
||||||
@@ -514,7 +514,7 @@ QString ToolChainKitAspect::displayNamePostfix(const Kit *k) const
|
|||||||
return tc ? tc->displayName() : QString();
|
return tc ? tc->displayName() : QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect::ItemList ToolChainKitAspect::toUserOutput(const Kit *k) const
|
KitAspectFactory::ItemList ToolChainKitAspect::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
ToolChain *tc = cxxToolChain(k);
|
ToolChain *tc = cxxToolChain(k);
|
||||||
return {{Tr::tr("Compiler"), tc ? tc->displayName() : Tr::tr("None")}};
|
return {{Tr::tr("Compiler"), tc ? tc->displayName() : Tr::tr("None")}};
|
||||||
@@ -755,11 +755,11 @@ void ToolChainKitAspect::toolChainRemoved(ToolChain *tc)
|
|||||||
// DeviceTypeKitAspect:
|
// DeviceTypeKitAspect:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class DeviceTypeKitAspectWidget final : public KitAspectWidget
|
class DeviceTypeKitAspectWidget final : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DeviceTypeKitAspectWidget(Kit *workingCopy, const KitAspect *ki)
|
DeviceTypeKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki)
|
||||||
: KitAspectWidget(workingCopy, ki), m_comboBox(createSubWidget<QComboBox>())
|
: KitAspect(workingCopy, ki), m_comboBox(createSubWidget<QComboBox>())
|
||||||
{
|
{
|
||||||
for (IDeviceFactory *factory : IDeviceFactory::allDeviceFactories())
|
for (IDeviceFactory *factory : IDeviceFactory::allDeviceFactories())
|
||||||
m_comboBox->addItem(factory->displayName(), factory->deviceType().toSetting());
|
m_comboBox->addItem(factory->displayName(), factory->deviceType().toSetting());
|
||||||
@@ -825,13 +825,13 @@ Tasks DeviceTypeKitAspect::validate(const Kit *k) const
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget *DeviceTypeKitAspect::createConfigWidget(Kit *k) const
|
KitAspect *DeviceTypeKitAspect::createKitAspect(Kit *k) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(k, return nullptr);
|
QTC_ASSERT(k, return nullptr);
|
||||||
return new Internal::DeviceTypeKitAspectWidget(k, this);
|
return new Internal::DeviceTypeKitAspectWidget(k, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect::ItemList DeviceTypeKitAspect::toUserOutput(const Kit *k) const
|
KitAspectFactory::ItemList DeviceTypeKitAspect::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(k, return {});
|
QTC_ASSERT(k, return {});
|
||||||
Id type = deviceTypeId(k);
|
Id type = deviceTypeId(k);
|
||||||
@@ -876,11 +876,11 @@ QSet<Id> DeviceTypeKitAspect::availableFeatures(const Kit *k) const
|
|||||||
// DeviceKitAspect:
|
// DeviceKitAspect:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class DeviceKitAspectWidget final : public KitAspectWidget
|
class DeviceKitAspectWidget final : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DeviceKitAspectWidget(Kit *workingCopy, const KitAspect *ki)
|
DeviceKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki)
|
||||||
: KitAspectWidget(workingCopy, ki),
|
: KitAspect(workingCopy, ki),
|
||||||
m_comboBox(createSubWidget<QComboBox>()),
|
m_comboBox(createSubWidget<QComboBox>()),
|
||||||
m_model(new DeviceManagerModel(DeviceManager::instance()))
|
m_model(new DeviceManagerModel(DeviceManager::instance()))
|
||||||
{
|
{
|
||||||
@@ -1014,7 +1014,7 @@ void DeviceKitAspect::setup(Kit *k)
|
|||||||
setDeviceId(k, Id::fromSetting(defaultValue(k)));
|
setDeviceId(k, Id::fromSetting(defaultValue(k)));
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget *DeviceKitAspect::createConfigWidget(Kit *k) const
|
KitAspect *DeviceKitAspect::createKitAspect(Kit *k) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(k, return nullptr);
|
QTC_ASSERT(k, return nullptr);
|
||||||
return new Internal::DeviceKitAspectWidget(k, this);
|
return new Internal::DeviceKitAspectWidget(k, this);
|
||||||
@@ -1026,7 +1026,7 @@ QString DeviceKitAspect::displayNamePostfix(const Kit *k) const
|
|||||||
return dev.isNull() ? QString() : dev->displayName();
|
return dev.isNull() ? QString() : dev->displayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect::ItemList DeviceKitAspect::toUserOutput(const Kit *k) const
|
KitAspectFactory::ItemList DeviceKitAspect::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
IDevice::ConstPtr dev = device(k);
|
IDevice::ConstPtr dev = device(k);
|
||||||
return {{Tr::tr("Device"), dev.isNull() ? Tr::tr("Unconfigured") : dev->displayName()}};
|
return {{Tr::tr("Device"), dev.isNull() ? Tr::tr("Unconfigured") : dev->displayName()}};
|
||||||
@@ -1138,11 +1138,11 @@ void DeviceKitAspect::devicesChanged()
|
|||||||
// BuildDeviceKitAspect:
|
// BuildDeviceKitAspect:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class BuildDeviceKitAspectWidget final : public KitAspectWidget
|
class BuildDeviceKitAspectWidget final : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BuildDeviceKitAspectWidget(Kit *workingCopy, const KitAspect *ki)
|
BuildDeviceKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki)
|
||||||
: KitAspectWidget(workingCopy, ki),
|
: KitAspect(workingCopy, ki),
|
||||||
m_comboBox(createSubWidget<QComboBox>()),
|
m_comboBox(createSubWidget<QComboBox>()),
|
||||||
m_model(new DeviceManagerModel(DeviceManager::instance()))
|
m_model(new DeviceManagerModel(DeviceManager::instance()))
|
||||||
{
|
{
|
||||||
@@ -1256,7 +1256,7 @@ Tasks BuildDeviceKitAspect::validate(const Kit *k) const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget *BuildDeviceKitAspect::createConfigWidget(Kit *k) const
|
KitAspect *BuildDeviceKitAspect::createKitAspect(Kit *k) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(k, return nullptr);
|
QTC_ASSERT(k, return nullptr);
|
||||||
return new Internal::BuildDeviceKitAspectWidget(k, this);
|
return new Internal::BuildDeviceKitAspectWidget(k, this);
|
||||||
@@ -1268,7 +1268,7 @@ QString BuildDeviceKitAspect::displayNamePostfix(const Kit *k) const
|
|||||||
return dev.isNull() ? QString() : dev->displayName();
|
return dev.isNull() ? QString() : dev->displayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect::ItemList BuildDeviceKitAspect::toUserOutput(const Kit *k) const
|
KitAspectFactory::ItemList BuildDeviceKitAspect::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
IDevice::ConstPtr dev = device(k);
|
IDevice::ConstPtr dev = device(k);
|
||||||
return {{Tr::tr("Build device"), dev.isNull() ? Tr::tr("Unconfigured") : dev->displayName()}};
|
return {{Tr::tr("Build device"), dev.isNull() ? Tr::tr("Unconfigured") : dev->displayName()}};
|
||||||
@@ -1388,11 +1388,11 @@ static bool enforcesMSVCEnglish(const EnvironmentItems &changes)
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class EnvironmentKitAspectWidget final : public KitAspectWidget
|
class EnvironmentKitAspectWidget final : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EnvironmentKitAspectWidget(Kit *workingCopy, const KitAspect *ki)
|
EnvironmentKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki)
|
||||||
: KitAspectWidget(workingCopy, ki),
|
: KitAspect(workingCopy, ki),
|
||||||
m_summaryLabel(createSubWidget<ElidingLabel>()),
|
m_summaryLabel(createSubWidget<ElidingLabel>()),
|
||||||
m_manageButton(createSubWidget<QPushButton>()),
|
m_manageButton(createSubWidget<QPushButton>()),
|
||||||
m_mainWidget(createSubWidget<QWidget>())
|
m_mainWidget(createSubWidget<QWidget>())
|
||||||
@@ -1532,13 +1532,13 @@ void EnvironmentKitAspect::addToRunEnvironment(const Kit *k, Environment &env) c
|
|||||||
addToBuildEnvironment(k, env);
|
addToBuildEnvironment(k, env);
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget *EnvironmentKitAspect::createConfigWidget(Kit *k) const
|
KitAspect *EnvironmentKitAspect::createKitAspect(Kit *k) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(k, return nullptr);
|
QTC_ASSERT(k, return nullptr);
|
||||||
return new Internal::EnvironmentKitAspectWidget(k, this);
|
return new Internal::EnvironmentKitAspectWidget(k, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect::ItemList EnvironmentKitAspect::toUserOutput(const Kit *k) const
|
KitAspectFactory::ItemList EnvironmentKitAspect::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
return {{Tr::tr("Environment"), EnvironmentItem::toStringList(environmentChanges(k)).join("<br>")}};
|
return {{Tr::tr("Environment"), EnvironmentItem::toStringList(environmentChanges(k)).join("<br>")}};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ namespace ProjectExplorer {
|
|||||||
class OutputTaskParser;
|
class OutputTaskParser;
|
||||||
class ToolChain;
|
class ToolChain;
|
||||||
|
|
||||||
class KitAspectWidget;
|
class KitAspect;
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// SysRootInformation:
|
// SysRootInformation:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT SysRootKitAspect : public KitAspect
|
class PROJECTEXPLORER_EXPORT SysRootKitAspect : public KitAspectFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ public:
|
|||||||
SysRootKitAspect();
|
SysRootKitAspect();
|
||||||
|
|
||||||
Tasks validate(const Kit *k) const override;
|
Tasks validate(const Kit *k) const override;
|
||||||
KitAspectWidget *createConfigWidget(Kit *k) const override;
|
KitAspect *createKitAspect(Kit *k) const override;
|
||||||
ItemList toUserOutput(const Kit *k) const override;
|
ItemList toUserOutput(const Kit *k) const override;
|
||||||
void addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const override;
|
void addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const override;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ public:
|
|||||||
// ToolChainInformation:
|
// ToolChainInformation:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT ToolChainKitAspect : public KitAspect
|
class PROJECTEXPLORER_EXPORT ToolChainKitAspect : public KitAspectFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ public:
|
|||||||
void fix(Kit *k) override;
|
void fix(Kit *k) override;
|
||||||
void setup(Kit *k) override;
|
void setup(Kit *k) override;
|
||||||
|
|
||||||
KitAspectWidget *createConfigWidget(Kit *k) const override;
|
KitAspect *createKitAspect(Kit *k) const override;
|
||||||
|
|
||||||
QString displayNamePostfix(const Kit *k) const override;
|
QString displayNamePostfix(const Kit *k) const override;
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ private:
|
|||||||
// DeviceTypeInformation:
|
// DeviceTypeInformation:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT DeviceTypeKitAspect : public KitAspect
|
class PROJECTEXPLORER_EXPORT DeviceTypeKitAspect : public KitAspectFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ public:
|
|||||||
|
|
||||||
void setup(Kit *k) override;
|
void setup(Kit *k) override;
|
||||||
Tasks validate(const Kit *k) const override;
|
Tasks validate(const Kit *k) const override;
|
||||||
KitAspectWidget *createConfigWidget(Kit *k) const override;
|
KitAspect *createKitAspect(Kit *k) const override;
|
||||||
ItemList toUserOutput(const Kit *k) const override;
|
ItemList toUserOutput(const Kit *k) const override;
|
||||||
|
|
||||||
static const Utils::Id id();
|
static const Utils::Id id();
|
||||||
@@ -115,7 +115,7 @@ public:
|
|||||||
// DeviceInformation:
|
// DeviceInformation:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT DeviceKitAspect : public KitAspect
|
class PROJECTEXPLORER_EXPORT DeviceKitAspect : public KitAspectFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ public:
|
|||||||
void fix(Kit *k) override;
|
void fix(Kit *k) override;
|
||||||
void setup(Kit *k) override;
|
void setup(Kit *k) override;
|
||||||
|
|
||||||
KitAspectWidget *createConfigWidget(Kit *k) const override;
|
KitAspect *createKitAspect(Kit *k) const override;
|
||||||
|
|
||||||
QString displayNamePostfix(const Kit *k) const override;
|
QString displayNamePostfix(const Kit *k) const override;
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ private:
|
|||||||
// BuildDeviceInformation:
|
// BuildDeviceInformation:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT BuildDeviceKitAspect : public KitAspect
|
class PROJECTEXPLORER_EXPORT BuildDeviceKitAspect : public KitAspectFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ public:
|
|||||||
void setup(Kit *k) override;
|
void setup(Kit *k) override;
|
||||||
Tasks validate(const Kit *k) const override;
|
Tasks validate(const Kit *k) const override;
|
||||||
|
|
||||||
KitAspectWidget *createConfigWidget(Kit *k) const override;
|
KitAspect *createKitAspect(Kit *k) const override;
|
||||||
|
|
||||||
QString displayNamePostfix(const Kit *k) const override;
|
QString displayNamePostfix(const Kit *k) const override;
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ private:
|
|||||||
// EnvironmentKitAspect:
|
// EnvironmentKitAspect:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT EnvironmentKitAspect : public KitAspect
|
class PROJECTEXPLORER_EXPORT EnvironmentKitAspect : public KitAspectFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ public:
|
|||||||
void addToBuildEnvironment(const Kit *k, Utils::Environment &env) const override;
|
void addToBuildEnvironment(const Kit *k, Utils::Environment &env) const override;
|
||||||
void addToRunEnvironment(const Kit *, Utils::Environment &) const override;
|
void addToRunEnvironment(const Kit *, Utils::Environment &) const override;
|
||||||
|
|
||||||
KitAspectWidget *createConfigWidget(Kit *k) const override;
|
KitAspect *createKitAspect(Kit *k) const override;
|
||||||
|
|
||||||
ItemList toUserOutput(const Kit *k) const override;
|
ItemList toUserOutput(const Kit *k) const override;
|
||||||
|
|
||||||
|
|||||||
@@ -75,23 +75,23 @@ public:
|
|||||||
std::unique_ptr<PersistentSettingsWriter> m_writer;
|
std::unique_ptr<PersistentSettingsWriter> m_writer;
|
||||||
QSet<Id> m_irrelevantAspects;
|
QSet<Id> m_irrelevantAspects;
|
||||||
|
|
||||||
void addKitAspect(KitAspect *ki)
|
void addKitAspect(KitAspectFactory *ki)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!m_aspectList.contains(ki), return);
|
QTC_ASSERT(!m_aspectList.contains(ki), return);
|
||||||
m_aspectList.append(ki);
|
m_aspectList.append(ki);
|
||||||
m_aspectListIsSorted = false;
|
m_aspectListIsSorted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeKitAspect(KitAspect *ki)
|
void removeKitAspect(KitAspectFactory *ki)
|
||||||
{
|
{
|
||||||
int removed = m_aspectList.removeAll(ki);
|
int removed = m_aspectList.removeAll(ki);
|
||||||
QTC_CHECK(removed == 1);
|
QTC_CHECK(removed == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QList<KitAspect *> kitAspects()
|
const QList<KitAspectFactory *> kitAspects()
|
||||||
{
|
{
|
||||||
if (!m_aspectListIsSorted) {
|
if (!m_aspectListIsSorted) {
|
||||||
Utils::sort(m_aspectList, [](const KitAspect *a, const KitAspect *b) {
|
Utils::sort(m_aspectList, [](const KitAspectFactory *a, const KitAspectFactory *b) {
|
||||||
return a->priority() > b->priority();
|
return a->priority() > b->priority();
|
||||||
});
|
});
|
||||||
m_aspectListIsSorted = true;
|
m_aspectListIsSorted = true;
|
||||||
@@ -104,7 +104,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// Sorted by priority, in descending order...
|
// Sorted by priority, in descending order...
|
||||||
QList<KitAspect *> m_aspectList;
|
QList<KitAspectFactory *> m_aspectList;
|
||||||
// ... if this here is set:
|
// ... if this here is set:
|
||||||
bool m_aspectListIsSorted = true;
|
bool m_aspectListIsSorted = true;
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ void KitManager::restoreKits()
|
|||||||
Kit *ptr = i->get();
|
Kit *ptr = i->get();
|
||||||
|
|
||||||
// Overwrite settings that the SDK sets to those values:
|
// Overwrite settings that the SDK sets to those values:
|
||||||
for (const KitAspect *aspect : KitManager::kitAspects()) {
|
for (const KitAspectFactory *aspect : KitManager::kitAspects()) {
|
||||||
// Copy sticky settings over:
|
// Copy sticky settings over:
|
||||||
ptr->setSticky(aspect->id(), toStore->isSticky(aspect->id()));
|
ptr->setSticky(aspect->id(), toStore->isSticky(aspect->id()));
|
||||||
if (ptr->isSticky(aspect->id()))
|
if (ptr->isSticky(aspect->id()))
|
||||||
@@ -455,7 +455,7 @@ bool KitManager::isLoaded()
|
|||||||
return d->m_initialized;
|
return d->m_initialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KitManager::registerKitAspect(KitAspect *ki)
|
void KitManager::registerKitAspect(KitAspectFactory *ki)
|
||||||
{
|
{
|
||||||
instance();
|
instance();
|
||||||
QTC_ASSERT(d, return);
|
QTC_ASSERT(d, return);
|
||||||
@@ -468,7 +468,7 @@ void KitManager::registerKitAspect(KitAspect *ki)
|
|||||||
QTC_CHECK(d->m_kitList.empty());
|
QTC_CHECK(d->m_kitList.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void KitManager::deregisterKitAspect(KitAspect *ki)
|
void KitManager::deregisterKitAspect(KitAspectFactory *ki)
|
||||||
{
|
{
|
||||||
// Happens regularly for the aspects from the ProjectExplorerPlugin as these
|
// Happens regularly for the aspects from the ProjectExplorerPlugin as these
|
||||||
// are destroyed after the manual call to KitManager::destroy() there, but as
|
// are destroyed after the manual call to KitManager::destroy() there, but as
|
||||||
@@ -578,7 +578,7 @@ Kit *KitManager::defaultKit()
|
|||||||
return d->m_defaultKit;
|
return d->m_defaultKit;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QList<KitAspect *> KitManager::kitAspects()
|
const QList<KitAspectFactory *> KitManager::kitAspects()
|
||||||
{
|
{
|
||||||
return d->kitAspects();
|
return d->kitAspects();
|
||||||
}
|
}
|
||||||
@@ -653,7 +653,7 @@ void KitManager::completeKit(Kit *k)
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(k, return);
|
QTC_ASSERT(k, return);
|
||||||
KitGuard g(k);
|
KitGuard g(k);
|
||||||
for (KitAspect *ki : d->kitAspects()) {
|
for (KitAspectFactory *ki : d->kitAspects()) {
|
||||||
ki->upgrade(k);
|
ki->upgrade(k);
|
||||||
if (!k->hasValue(ki->id()))
|
if (!k->hasValue(ki->id()))
|
||||||
ki->setup(k);
|
ki->setup(k);
|
||||||
@@ -666,73 +666,73 @@ void KitManager::completeKit(Kit *k)
|
|||||||
// KitAspect:
|
// KitAspect:
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
KitAspect::KitAspect()
|
KitAspectFactory::KitAspectFactory()
|
||||||
{
|
{
|
||||||
KitManager::registerKitAspect(this);
|
KitManager::registerKitAspect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect::~KitAspect()
|
KitAspectFactory::~KitAspectFactory()
|
||||||
{
|
{
|
||||||
KitManager::deregisterKitAspect(this);
|
KitManager::deregisterKitAspect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
int KitAspect::weight(const Kit *k) const
|
int KitAspectFactory::weight(const Kit *k) const
|
||||||
{
|
{
|
||||||
return k->value(id()).isValid() ? 1 : 0;
|
return k->value(id()).isValid() ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KitAspect::addToBuildEnvironment(const Kit *k, Environment &env) const
|
void KitAspectFactory::addToBuildEnvironment(const Kit *k, Environment &env) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(k)
|
Q_UNUSED(k)
|
||||||
Q_UNUSED(env)
|
Q_UNUSED(env)
|
||||||
}
|
}
|
||||||
|
|
||||||
void KitAspect::addToRunEnvironment(const Kit *k, Environment &env) const
|
void KitAspectFactory::addToRunEnvironment(const Kit *k, Environment &env) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(k)
|
Q_UNUSED(k)
|
||||||
Q_UNUSED(env)
|
Q_UNUSED(env)
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<OutputLineParser *> KitAspect::createOutputParsers(const Kit *k) const
|
QList<OutputLineParser *> KitAspectFactory::createOutputParsers(const Kit *k) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(k)
|
Q_UNUSED(k)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
QString KitAspect::displayNamePostfix(const Kit *k) const
|
QString KitAspectFactory::displayNamePostfix(const Kit *k) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(k)
|
Q_UNUSED(k)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<Id> KitAspect::supportedPlatforms(const Kit *k) const
|
QSet<Id> KitAspectFactory::supportedPlatforms(const Kit *k) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(k)
|
Q_UNUSED(k)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<Id> KitAspect::availableFeatures(const Kit *k) const
|
QSet<Id> KitAspectFactory::availableFeatures(const Kit *k) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(k)
|
Q_UNUSED(k)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
void KitAspect::addToMacroExpander(Kit *k, MacroExpander *expander) const
|
void KitAspectFactory::addToMacroExpander(Kit *k, MacroExpander *expander) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(k)
|
Q_UNUSED(k)
|
||||||
Q_UNUSED(expander)
|
Q_UNUSED(expander)
|
||||||
}
|
}
|
||||||
|
|
||||||
void KitAspect::notifyAboutUpdate(Kit *k)
|
void KitAspectFactory::notifyAboutUpdate(Kit *k)
|
||||||
{
|
{
|
||||||
if (k)
|
if (k)
|
||||||
k->kitUpdated();
|
k->kitUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget::KitAspectWidget(Kit *kit, const KitAspect *ki)
|
KitAspect::KitAspect(Kit *kit, const KitAspectFactory *factory)
|
||||||
: m_kit(kit), m_kitInformation(ki)
|
: m_kit(kit), m_factory(factory)
|
||||||
{
|
{
|
||||||
const Id id = ki->id();
|
const Id id = factory->id();
|
||||||
m_mutableAction = new QAction(Tr::tr("Mark as Mutable"));
|
m_mutableAction = new QAction(Tr::tr("Mark as Mutable"));
|
||||||
m_mutableAction->setCheckable(true);
|
m_mutableAction->setCheckable(true);
|
||||||
m_mutableAction->setChecked(m_kit->isMutable(id));
|
m_mutableAction->setChecked(m_kit->isMutable(id));
|
||||||
@@ -742,16 +742,16 @@ KitAspectWidget::KitAspectWidget(Kit *kit, const KitAspect *ki)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget::~KitAspectWidget()
|
KitAspect::~KitAspect()
|
||||||
{
|
{
|
||||||
delete m_mutableAction;
|
delete m_mutableAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KitAspectWidget::addToLayoutWithLabel(Layouting::LayoutItem &parentItem, QWidget *parent)
|
void KitAspect::addToLayoutWithLabel(Layouting::LayoutItem &parentItem, QWidget *parent)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(parent, return);
|
QTC_ASSERT(parent, return);
|
||||||
auto label = createSubWidget<QLabel>(m_kitInformation->displayName() + ':');
|
auto label = createSubWidget<QLabel>(m_factory->displayName() + ':');
|
||||||
label->setToolTip(m_kitInformation->description());
|
label->setToolTip(m_factory->description());
|
||||||
connect(label, &QLabel::linkActivated, this, [this](const QString &link) {
|
connect(label, &QLabel::linkActivated, this, [this](const QString &link) {
|
||||||
emit labelLinkActivated(link);
|
emit labelLinkActivated(link);
|
||||||
});
|
});
|
||||||
@@ -761,14 +761,14 @@ void KitAspectWidget::addToLayoutWithLabel(Layouting::LayoutItem &parentItem, QW
|
|||||||
parentItem.addItem(Layouting::br);
|
parentItem.addItem(Layouting::br);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KitAspectWidget::addMutableAction(QWidget *child)
|
void KitAspect::addMutableAction(QWidget *child)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(child, return);
|
QTC_ASSERT(child, return);
|
||||||
child->addAction(m_mutableAction);
|
child->addAction(m_mutableAction);
|
||||||
child->setContextMenuPolicy(Qt::ActionsContextMenu);
|
child->setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *KitAspectWidget::createManageButton(Id pageId)
|
QWidget *KitAspect::createManageButton(Id pageId)
|
||||||
{
|
{
|
||||||
auto button = createSubWidget<QPushButton>(msgManage());
|
auto button = createSubWidget<QPushButton>(msgManage());
|
||||||
connect(button, &QPushButton::clicked, this, [pageId] {
|
connect(button, &QPushButton::clicked, this, [pageId] {
|
||||||
@@ -777,7 +777,7 @@ QWidget *KitAspectWidget::createManageButton(Id pageId)
|
|||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString KitAspectWidget::msgManage()
|
QString KitAspect::msgManage()
|
||||||
{
|
{
|
||||||
return Tr::tr("Manage...");
|
return Tr::tr("Manage...");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,6 @@
|
|||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
class QLabel;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
class Environment;
|
class Environment;
|
||||||
class FilePath;
|
class FilePath;
|
||||||
@@ -29,8 +25,7 @@ class OutputLineParser;
|
|||||||
} // namespace Utils
|
} // namespace Utils
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
class Task;
|
class KitAspect;
|
||||||
class KitAspectWidget;
|
|
||||||
class KitManager;
|
class KitManager;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -38,13 +33,14 @@ class KitManagerConfigWidget;
|
|||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The KitAspect class
|
* @brief The KitAspectFactory class
|
||||||
*
|
*
|
||||||
* One piece of information stored in the kit.
|
* A KitAspectFactory can create instances of one type of KitAspect.
|
||||||
|
* A KitAspect handles a specific piece of information stored in the kit.
|
||||||
*
|
*
|
||||||
* They auto-register with the \a KitManager for their life time
|
* They auto-register with the \a KitManager for their life time
|
||||||
*/
|
*/
|
||||||
class PROJECTEXPLORER_EXPORT KitAspect : public QObject
|
class PROJECTEXPLORER_EXPORT KitAspectFactory : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -71,7 +67,7 @@ public:
|
|||||||
|
|
||||||
virtual ItemList toUserOutput(const Kit *) const = 0;
|
virtual ItemList toUserOutput(const Kit *) const = 0;
|
||||||
|
|
||||||
virtual KitAspectWidget *createConfigWidget(Kit *) const = 0;
|
virtual KitAspect *createKitAspect(Kit *) const = 0;
|
||||||
|
|
||||||
virtual void addToBuildEnvironment(const Kit *k, Utils::Environment &env) const;
|
virtual void addToBuildEnvironment(const Kit *k, Utils::Environment &env) const;
|
||||||
virtual void addToRunEnvironment(const Kit *k, Utils::Environment &env) const;
|
virtual void addToRunEnvironment(const Kit *k, Utils::Environment &env) const;
|
||||||
@@ -88,8 +84,8 @@ public:
|
|||||||
virtual bool isApplicableToKit(const Kit *) const { return true; }
|
virtual bool isApplicableToKit(const Kit *) const { return true; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
KitAspect();
|
KitAspectFactory();
|
||||||
~KitAspect();
|
~KitAspectFactory();
|
||||||
|
|
||||||
void setId(Utils::Id id) { m_id = id; }
|
void setId(Utils::Id id) { m_id = id; }
|
||||||
void setDisplayName(const QString &name) { m_displayName = name; }
|
void setDisplayName(const QString &name) { m_displayName = name; }
|
||||||
@@ -106,13 +102,13 @@ private:
|
|||||||
bool m_essential = false;
|
bool m_essential = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT KitAspectWidget : public Utils::BaseAspect
|
class PROJECTEXPLORER_EXPORT KitAspect : public Utils::BaseAspect
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
KitAspectWidget(Kit *kit, const KitAspect *ki);
|
KitAspect(Kit *kit, const KitAspectFactory *factory);
|
||||||
~KitAspectWidget();
|
~KitAspect();
|
||||||
|
|
||||||
virtual void makeReadOnly() = 0;
|
virtual void makeReadOnly() = 0;
|
||||||
virtual void refresh() = 0;
|
virtual void refresh() = 0;
|
||||||
@@ -122,14 +118,14 @@ public:
|
|||||||
static QString msgManage();
|
static QString msgManage();
|
||||||
|
|
||||||
Kit *kit() const { return m_kit; }
|
Kit *kit() const { return m_kit; }
|
||||||
const KitAspect *kitInformation() const { return m_kitInformation; }
|
const KitAspectFactory *kitInformation() const { return m_factory; }
|
||||||
QAction *mutableAction() const { return m_mutableAction; }
|
QAction *mutableAction() const { return m_mutableAction; }
|
||||||
void addMutableAction(QWidget *child);
|
void addMutableAction(QWidget *child);
|
||||||
QWidget *createManageButton(Utils::Id pageId);
|
QWidget *createManageButton(Utils::Id pageId);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Kit *m_kit;
|
Kit *m_kit;
|
||||||
const KitAspect *m_kitInformation;
|
const KitAspectFactory *m_factory;
|
||||||
QAction *m_mutableAction = nullptr;
|
QAction *m_mutableAction = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -146,7 +142,7 @@ public:
|
|||||||
static Kit *kit(Utils::Id id);
|
static Kit *kit(Utils::Id id);
|
||||||
static Kit *defaultKit();
|
static Kit *defaultKit();
|
||||||
|
|
||||||
static const QList<KitAspect *> kitAspects();
|
static const QList<KitAspectFactory *> kitAspects();
|
||||||
static const QSet<Utils::Id> irrelevantAspects();
|
static const QSet<Utils::Id> irrelevantAspects();
|
||||||
static void setIrrelevantAspects(const QSet<Utils::Id> &aspects);
|
static void setIrrelevantAspects(const QSet<Utils::Id> &aspects);
|
||||||
|
|
||||||
@@ -179,8 +175,8 @@ private:
|
|||||||
|
|
||||||
static void destroy();
|
static void destroy();
|
||||||
|
|
||||||
static void registerKitAspect(KitAspect *ki);
|
static void registerKitAspect(KitAspectFactory *ki);
|
||||||
static void deregisterKitAspect(KitAspect *ki);
|
static void deregisterKitAspect(KitAspectFactory *ki);
|
||||||
|
|
||||||
static void setBinaryForKit(const Utils::FilePath &binary);
|
static void setBinaryForKit(const Utils::FilePath &binary);
|
||||||
|
|
||||||
@@ -194,7 +190,7 @@ private:
|
|||||||
friend class ProjectExplorerPlugin; // for constructor
|
friend class ProjectExplorerPlugin; // for constructor
|
||||||
friend class Kit;
|
friend class Kit;
|
||||||
friend class Internal::KitManagerConfigWidget;
|
friend class Internal::KitManagerConfigWidget;
|
||||||
friend class KitAspect; // for notifyAboutUpdate and self-registration
|
friend class KitAspectFactory; // for notifyAboutUpdate and self-registration
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k, bool &isDefaultKit, bool
|
|||||||
chooser->addSupportedWidget(m_nameEdit);
|
chooser->addSupportedWidget(m_nameEdit);
|
||||||
chooser->addMacroExpanderProvider([this] { return m_modifiedKit->macroExpander(); });
|
chooser->addMacroExpanderProvider([this] { return m_modifiedKit->macroExpander(); });
|
||||||
|
|
||||||
for (KitAspect *aspect : KitManager::kitAspects())
|
for (KitAspectFactory *aspect : KitManager::kitAspects())
|
||||||
addAspectToWorkingCopy(page, aspect);
|
addAspectToWorkingCopy(page, aspect);
|
||||||
|
|
||||||
page.attachTo(this);
|
page.attachTo(this);
|
||||||
@@ -195,10 +195,10 @@ QString KitManagerConfigWidget::validityMessage() const
|
|||||||
return m_modifiedKit->toHtml(tmp);
|
return m_modifiedKit->toHtml(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KitManagerConfigWidget::addAspectToWorkingCopy(Layouting::LayoutItem &parent, KitAspect *aspect)
|
void KitManagerConfigWidget::addAspectToWorkingCopy(Layouting::LayoutItem &parent, KitAspectFactory *factory)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(aspect, return);
|
QTC_ASSERT(factory, return);
|
||||||
KitAspectWidget *widget = aspect->createConfigWidget(workingCopy());
|
KitAspect *widget = factory->createKitAspect(workingCopy());
|
||||||
QTC_ASSERT(widget, return);
|
QTC_ASSERT(widget, return);
|
||||||
QTC_ASSERT(!m_widgets.contains(widget), return);
|
QTC_ASSERT(!m_widgets.contains(widget), return);
|
||||||
|
|
||||||
@@ -213,8 +213,8 @@ void KitManagerConfigWidget::updateVisibility()
|
|||||||
{
|
{
|
||||||
int count = m_widgets.count();
|
int count = m_widgets.count();
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
KitAspectWidget *widget = m_widgets.at(i);
|
KitAspect *widget = m_widgets.at(i);
|
||||||
const KitAspect *ki = widget->kitInformation();
|
const KitAspectFactory *ki = widget->kitInformation();
|
||||||
const bool visibleInKit = ki->isApplicableToKit(m_modifiedKit.get());
|
const bool visibleInKit = ki->isApplicableToKit(m_modifiedKit.get());
|
||||||
const bool irrelevant = m_modifiedKit->irrelevantAspects().contains(ki->id());
|
const bool irrelevant = m_modifiedKit->irrelevantAspects().contains(ki->id());
|
||||||
widget->setVisible(visibleInKit && !irrelevant);
|
widget->setVisible(visibleInKit && !irrelevant);
|
||||||
@@ -223,7 +223,7 @@ void KitManagerConfigWidget::updateVisibility()
|
|||||||
|
|
||||||
void KitManagerConfigWidget::makeStickySubWidgetsReadOnly()
|
void KitManagerConfigWidget::makeStickySubWidgetsReadOnly()
|
||||||
{
|
{
|
||||||
for (KitAspectWidget *w : std::as_const(m_widgets)) {
|
for (KitAspect *w : std::as_const(m_widgets)) {
|
||||||
if (w->kit()->isSticky(w->kitInformation()->id()))
|
if (w->kit()->isSticky(w->kitInformation()->id()))
|
||||||
w->makeReadOnly();
|
w->makeReadOnly();
|
||||||
}
|
}
|
||||||
@@ -314,7 +314,7 @@ void KitManagerConfigWidget::workingCopyWasUpdated(Kit *k)
|
|||||||
k->fix();
|
k->fix();
|
||||||
m_fixingKit = false;
|
m_fixingKit = false;
|
||||||
|
|
||||||
for (KitAspectWidget *w : std::as_const(m_widgets))
|
for (KitAspect *w : std::as_const(m_widgets))
|
||||||
w->refresh();
|
w->refresh();
|
||||||
|
|
||||||
m_cachedDisplayName.clear();
|
m_cachedDisplayName.clear();
|
||||||
@@ -342,7 +342,7 @@ void KitManagerConfigWidget::kitWasUpdated(Kit *k)
|
|||||||
void KitManagerConfigWidget::showEvent(QShowEvent *event)
|
void KitManagerConfigWidget::showEvent(QShowEvent *event)
|
||||||
{
|
{
|
||||||
Q_UNUSED(event)
|
Q_UNUSED(event)
|
||||||
for (KitAspectWidget *widget : std::as_const(m_widgets))
|
for (KitAspect *widget : std::as_const(m_widgets))
|
||||||
widget->refresh();
|
widget->refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public:
|
|||||||
void discard();
|
void discard();
|
||||||
bool isDirty() const;
|
bool isDirty() const;
|
||||||
QString validityMessage() const;
|
QString validityMessage() const;
|
||||||
void addAspectToWorkingCopy(Layouting::LayoutItem &parent, KitAspect *aspect);
|
void addAspectToWorkingCopy(Layouting::LayoutItem &parent, KitAspectFactory *factory);
|
||||||
void makeStickySubWidgetsReadOnly();
|
void makeStickySubWidgetsReadOnly();
|
||||||
|
|
||||||
Kit *workingCopy() const;
|
Kit *workingCopy() const;
|
||||||
@@ -66,7 +66,7 @@ private:
|
|||||||
QToolButton *m_iconButton;
|
QToolButton *m_iconButton;
|
||||||
QLineEdit *m_nameEdit;
|
QLineEdit *m_nameEdit;
|
||||||
QLineEdit *m_fileSystemFriendlyNameLineEdit;
|
QLineEdit *m_fileSystemFriendlyNameLineEdit;
|
||||||
QList<KitAspectWidget *> m_widgets;
|
QList<KitAspect *> m_widgets;
|
||||||
Kit *m_kit;
|
Kit *m_kit;
|
||||||
std::unique_ptr<Kit> m_modifiedKit;
|
std::unique_ptr<Kit> m_modifiedKit;
|
||||||
bool &m_isDefaultKit;
|
bool &m_isDefaultKit;
|
||||||
|
|||||||
@@ -565,7 +565,7 @@ int SelectorView::padding()
|
|||||||
/////////
|
/////////
|
||||||
// KitAreaWidget
|
// KitAreaWidget
|
||||||
/////////
|
/////////
|
||||||
void doLayout(KitAspectWidget *widget, Layouting::LayoutItem &builder)
|
void doLayout(KitAspect *widget, Layouting::LayoutItem &builder)
|
||||||
{
|
{
|
||||||
widget->addToLayout(builder);
|
widget->addToLayout(builder);
|
||||||
}
|
}
|
||||||
@@ -593,9 +593,9 @@ public:
|
|||||||
delete layout();
|
delete layout();
|
||||||
|
|
||||||
Layouting::Grid grid;
|
Layouting::Grid grid;
|
||||||
for (KitAspect *aspect : KitManager::kitAspects()) {
|
for (KitAspectFactory *aspect : KitManager::kitAspects()) {
|
||||||
if (k && k->isMutable(aspect->id())) {
|
if (k && k->isMutable(aspect->id())) {
|
||||||
KitAspectWidget *widget = aspect->createConfigWidget(k);
|
KitAspect *widget = aspect->createKitAspect(k);
|
||||||
m_widgets << widget;
|
m_widgets << widget;
|
||||||
grid.addItems({aspect->displayName(), widget, Layouting::br});
|
grid.addItems({aspect->displayName(), widget, Layouting::br});
|
||||||
}
|
}
|
||||||
@@ -615,10 +615,10 @@ private:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
bool addedMutables = false;
|
bool addedMutables = false;
|
||||||
QList<const KitAspect *> knownList
|
QList<const KitAspectFactory *> knownList
|
||||||
= Utils::transform(m_widgets, &KitAspectWidget::kitInformation);
|
= Utils::transform(m_widgets, &KitAspect::kitInformation);
|
||||||
|
|
||||||
for (KitAspect *aspect : KitManager::kitAspects()) {
|
for (KitAspectFactory *aspect : KitManager::kitAspects()) {
|
||||||
const Utils::Id currentId = aspect->id();
|
const Utils::Id currentId = aspect->id();
|
||||||
if (m_kit->isMutable(currentId) && !knownList.removeOne(aspect)) {
|
if (m_kit->isMutable(currentId) && !knownList.removeOne(aspect)) {
|
||||||
addedMutables = true;
|
addedMutables = true;
|
||||||
@@ -632,13 +632,13 @@ private:
|
|||||||
setKit(m_kit);
|
setKit(m_kit);
|
||||||
} else {
|
} else {
|
||||||
// Refresh all widgets if the number of mutable settings did not change
|
// Refresh all widgets if the number of mutable settings did not change
|
||||||
for (KitAspectWidget *w : std::as_const(m_widgets))
|
for (KitAspect *w : std::as_const(m_widgets))
|
||||||
w->refresh();
|
w->refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Kit *m_kit = nullptr;
|
Kit *m_kit = nullptr;
|
||||||
QList<KitAspectWidget *> m_widgets;
|
QList<KitAspect *> m_widgets;
|
||||||
};
|
};
|
||||||
|
|
||||||
/////////
|
/////////
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ TargetSetupWidget::TargetSetupWidget(Kit *k, const FilePath &projectPath) :
|
|||||||
|
|
||||||
auto panel = new FadingWidget(m_detailsWidget);
|
auto panel = new FadingWidget(m_detailsWidget);
|
||||||
auto panelLayout = new QHBoxLayout(panel);
|
auto panelLayout = new QHBoxLayout(panel);
|
||||||
m_manageButton = new QPushButton(KitAspectWidget::msgManage());
|
m_manageButton = new QPushButton(KitAspect::msgManage());
|
||||||
panelLayout->addWidget(m_manageButton);
|
panelLayout->addWidget(m_manageButton);
|
||||||
m_detailsWidget->setToolWidget(panel);
|
m_detailsWidget->setToolWidget(panel);
|
||||||
|
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ using namespace ProjectExplorer;
|
|||||||
namespace QbsProjectManager {
|
namespace QbsProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class AspectWidget final : public KitAspectWidget
|
class AspectWidget final : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AspectWidget(Kit *kit, const KitAspect *kitInfo)
|
AspectWidget(Kit *kit, const KitAspectFactory *kitInfo)
|
||||||
: KitAspectWidget(kit, kitInfo),
|
: KitAspect(kit, kitInfo),
|
||||||
m_contentLabel(createSubWidget<Utils::ElidingLabel>()),
|
m_contentLabel(createSubWidget<Utils::ElidingLabel>()),
|
||||||
m_changeButton(createSubWidget<QPushButton>(Tr::tr("Change...")))
|
m_changeButton(createSubWidget<QPushButton>(Tr::tr("Change...")))
|
||||||
{
|
{
|
||||||
@@ -92,12 +92,12 @@ Utils::Id QbsKitAspect::id()
|
|||||||
|
|
||||||
Tasks QbsKitAspect::validate(const Kit *) const { return {}; }
|
Tasks QbsKitAspect::validate(const Kit *) const { return {}; }
|
||||||
|
|
||||||
KitAspect::ItemList QbsKitAspect::toUserOutput(const Kit *k) const
|
KitAspectFactory::ItemList QbsKitAspect::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
return {{displayName(), representation(k)}};
|
return {{displayName(), representation(k)}};
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget *QbsKitAspect::createConfigWidget(Kit *k) const
|
KitAspect *QbsKitAspect::createKitAspect(Kit *k) const
|
||||||
{
|
{
|
||||||
return new AspectWidget(k, this);
|
return new AspectWidget(k, this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
namespace QbsProjectManager {
|
namespace QbsProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QbsKitAspect final : public ProjectExplorer::KitAspect
|
class QbsKitAspect final : public ProjectExplorer::KitAspectFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ private:
|
|||||||
|
|
||||||
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *) const override;
|
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *) const override;
|
||||||
ItemList toUserOutput(const ProjectExplorer::Kit *) const override;
|
ItemList toUserOutput(const ProjectExplorer::Kit *) const override;
|
||||||
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *) const override;
|
ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ using namespace Utils;
|
|||||||
namespace QmakeProjectManager {
|
namespace QmakeProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QmakeKitAspectWidget final : public KitAspectWidget
|
class QmakeKitAspectWidget final : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QmakeKitAspectWidget(Kit *k, const KitAspect *ki)
|
QmakeKitAspectWidget(Kit *k, const KitAspectFactory *ki)
|
||||||
: KitAspectWidget(k, ki), m_lineEdit(createSubWidget<QLineEdit>())
|
: KitAspect(k, ki), m_lineEdit(createSubWidget<QLineEdit>())
|
||||||
{
|
{
|
||||||
refresh(); // set up everything according to kit
|
refresh(); // set up everything according to kit
|
||||||
m_lineEdit->setToolTip(ki->description());
|
m_lineEdit->setToolTip(ki->description());
|
||||||
@@ -89,12 +89,12 @@ Tasks QmakeKitAspect::validate(const Kit *k) const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget *QmakeKitAspect::createConfigWidget(Kit *k) const
|
KitAspect *QmakeKitAspect::createKitAspect(Kit *k) const
|
||||||
{
|
{
|
||||||
return new Internal::QmakeKitAspectWidget(k, this);
|
return new Internal::QmakeKitAspectWidget(k, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect::ItemList QmakeKitAspect::toUserOutput(const Kit *k) const
|
KitAspectFactory::ItemList QmakeKitAspect::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
return {{Tr::tr("mkspec"), QDir::toNativeSeparators(mkspec(k))}};
|
return {{Tr::tr("mkspec"), QDir::toNativeSeparators(mkspec(k))}};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
namespace QmakeProjectManager {
|
namespace QmakeProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QmakeKitAspect : public ProjectExplorer::KitAspect
|
class QmakeKitAspect : public ProjectExplorer::KitAspectFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ public:
|
|||||||
|
|
||||||
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const override;
|
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const override;
|
||||||
|
|
||||||
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const override;
|
ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const override;
|
||||||
|
|
||||||
ItemList toUserOutput(const ProjectExplorer::Kit *k) const override;
|
ItemList toUserOutput(const ProjectExplorer::Kit *k) const override;
|
||||||
|
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ using namespace Utils;
|
|||||||
namespace QtSupport {
|
namespace QtSupport {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QtKitAspectWidget final : public KitAspectWidget
|
class QtKitAspectWidget final : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QtKitAspectWidget(Kit *k, const KitAspect *ki) : KitAspectWidget(k, ki)
|
QtKitAspectWidget(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki)
|
||||||
{
|
{
|
||||||
m_combo = createSubWidget<QComboBox>();
|
m_combo = createSubWidget<QComboBox>();
|
||||||
m_combo->setSizePolicy(QSizePolicy::Ignored, m_combo->sizePolicy().verticalPolicy());
|
m_combo->setSizePolicy(QSizePolicy::Ignored, m_combo->sizePolicy().verticalPolicy());
|
||||||
@@ -260,7 +260,7 @@ void QtKitAspect::fix(Kit *k)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspectWidget *QtKitAspect::createConfigWidget(Kit *k) const
|
KitAspect *QtKitAspect::createKitAspect(Kit *k) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(k, return nullptr);
|
QTC_ASSERT(k, return nullptr);
|
||||||
return new Internal::QtKitAspectWidget(k, this);
|
return new Internal::QtKitAspectWidget(k, this);
|
||||||
@@ -272,7 +272,7 @@ QString QtKitAspect::displayNamePostfix(const Kit *k) const
|
|||||||
return version ? version->displayName() : QString();
|
return version ? version->displayName() : QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect::ItemList QtKitAspect::toUserOutput(const Kit *k) const
|
KitAspectFactory::ItemList QtKitAspect::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
QtVersion *version = qtVersion(k);
|
QtVersion *version = qtVersion(k);
|
||||||
return {{Tr::tr("Qt version"), version ? version->displayName() : Tr::tr("None")}};
|
return {{Tr::tr("Qt version"), version ? version->displayName() : Tr::tr("None")}};
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Utils { class MacroExpander; }
|
|||||||
|
|
||||||
namespace QtSupport {
|
namespace QtSupport {
|
||||||
|
|
||||||
class QTSUPPORT_EXPORT QtKitAspect : public ProjectExplorer::KitAspect
|
class QTSUPPORT_EXPORT QtKitAspect : public ProjectExplorer::KitAspectFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ public:
|
|||||||
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const override;
|
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const override;
|
||||||
void fix(ProjectExplorer::Kit *) override;
|
void fix(ProjectExplorer::Kit *) override;
|
||||||
|
|
||||||
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const override;
|
ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const override;
|
||||||
|
|
||||||
QString displayNamePostfix(const ProjectExplorer::Kit *k) const override;
|
QString displayNamePostfix(const ProjectExplorer::Kit *k) const override;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user