forked from qt-creator/qt-creator
Qbs: Rename some of the KitAspect related classes
... and split out the static interface. Change-Id: I62d2a188e75bbc3e3d912c3ebf0c4300bec9fb79 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -20,15 +20,15 @@ using namespace ProjectExplorer;
|
|||||||
namespace QbsProjectManager {
|
namespace QbsProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class AspectWidget final : public KitAspect
|
class QbsKitAspectImpl final : public KitAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AspectWidget(Kit *kit, const KitAspectFactory *kitInfo)
|
QbsKitAspectImpl(Kit *kit, const KitAspectFactory *kitInfo)
|
||||||
: KitAspect(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...")))
|
||||||
{
|
{
|
||||||
connect(m_changeButton, &QPushButton::clicked, this, &AspectWidget::changeProperties);
|
connect(m_changeButton, &QPushButton::clicked, this, &QbsKitAspectImpl::changeProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -53,7 +53,7 @@ private:
|
|||||||
QPushButton * const m_changeButton;
|
QPushButton * const m_changeButton;
|
||||||
};
|
};
|
||||||
|
|
||||||
QbsKitAspect::QbsKitAspect()
|
QbsKitAspectFactory::QbsKitAspectFactory()
|
||||||
{
|
{
|
||||||
setObjectName(QLatin1String("QbsKitAspect"));
|
setObjectName(QLatin1String("QbsKitAspect"));
|
||||||
setId(QbsKitAspect::id());
|
setId(QbsKitAspect::id());
|
||||||
@@ -90,16 +90,19 @@ Utils::Id QbsKitAspect::id()
|
|||||||
return "Qbs.KitInformation";
|
return "Qbs.KitInformation";
|
||||||
}
|
}
|
||||||
|
|
||||||
Tasks QbsKitAspect::validate(const Kit *) const { return {}; }
|
Tasks QbsKitAspectFactory::validate(const Kit *) const
|
||||||
|
|
||||||
KitAspectFactory::ItemList QbsKitAspect::toUserOutput(const Kit *k) const
|
|
||||||
{
|
{
|
||||||
return {{displayName(), representation(k)}};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
KitAspect *QbsKitAspect::createKitAspect(Kit *k) const
|
KitAspectFactory::ItemList QbsKitAspectFactory::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
return new AspectWidget(k, this);
|
return {{displayName(), QbsKitAspect::representation(k)}};
|
||||||
|
}
|
||||||
|
|
||||||
|
KitAspect *QbsKitAspectFactory::createKitAspect(Kit *k) const
|
||||||
|
{
|
||||||
|
return new QbsKitAspectImpl(k, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -8,20 +8,24 @@
|
|||||||
namespace QbsProjectManager {
|
namespace QbsProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QbsKitAspect final : public ProjectExplorer::KitAspectFactory
|
class QbsKitAspect final
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QbsKitAspect();
|
|
||||||
|
|
||||||
static QString representation(const ProjectExplorer::Kit *kit);
|
static QString representation(const ProjectExplorer::Kit *kit);
|
||||||
static QVariantMap properties(const ProjectExplorer::Kit *kit);
|
static QVariantMap properties(const ProjectExplorer::Kit *kit);
|
||||||
static void setProperties(ProjectExplorer::Kit *kit, const QVariantMap &properties);
|
static void setProperties(ProjectExplorer::Kit *kit, const QVariantMap &properties);
|
||||||
|
|
||||||
private:
|
|
||||||
static Utils::Id id();
|
static Utils::Id id();
|
||||||
|
};
|
||||||
|
|
||||||
|
class QbsKitAspectFactory final : public ProjectExplorer::KitAspectFactory
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
QbsKitAspectFactory();
|
||||||
|
|
||||||
|
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::KitAspect *createKitAspect(ProjectExplorer::Kit *) const override;
|
ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const override;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public:
|
|||||||
QbsInstallStepFactory installStepFactory;
|
QbsInstallStepFactory installStepFactory;
|
||||||
QbsSettingsPage settingsPage;
|
QbsSettingsPage settingsPage;
|
||||||
QbsProfilesSettingsPage profilesSetttingsPage;
|
QbsProfilesSettingsPage profilesSetttingsPage;
|
||||||
QbsKitAspect qbsKitAspect;
|
QbsKitAspectFactory qbsKitAspectFactory;
|
||||||
};
|
};
|
||||||
|
|
||||||
QbsProjectManagerPlugin::~QbsProjectManagerPlugin()
|
QbsProjectManagerPlugin::~QbsProjectManagerPlugin()
|
||||||
|
|||||||
Reference in New Issue
Block a user