forked from qt-creator/qt-creator
ProjectExplorer: Inline KitManager::createConfigWidget
Instead of creating the widget first and polish it, create a polished widget directly. Change-Id: I665d26d6cbd87187f6d29ec3246a7db5c69d1a7f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -370,17 +370,6 @@ const QList<KitAspect *> KitManager::kitAspects()
|
||||
return Utils::toRawPointer<QList>(d->m_informationList);
|
||||
}
|
||||
|
||||
KitManagerConfigWidget *KitManager::createConfigWidget(Kit *k)
|
||||
{
|
||||
auto *result = new KitManagerConfigWidget(k);
|
||||
for (KitAspect *aspect : kitAspects())
|
||||
result->addAspectToWorkingCopy(aspect);
|
||||
|
||||
result->updateVisibility();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void KitManager::notifyAboutUpdate(Kit *k)
|
||||
{
|
||||
if (!k || !isLoaded())
|
||||
|
@@ -54,7 +54,6 @@ class KitAspectWidget;
|
||||
class KitManager;
|
||||
|
||||
namespace Internal {
|
||||
class KitManagerConfigWidget;
|
||||
class KitModel;
|
||||
} // namespace Internal
|
||||
|
||||
@@ -170,8 +169,6 @@ public:
|
||||
|
||||
static const QList<KitAspect *> kitAspects();
|
||||
|
||||
static Internal::KitManagerConfigWidget *createConfigWidget(Kit *k);
|
||||
|
||||
static bool registerKit(std::unique_ptr<Kit> &&k);
|
||||
static void deregisterKit(Kit *k);
|
||||
static void setDefaultKit(Kit *k);
|
||||
|
@@ -121,6 +121,11 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k) :
|
||||
auto chooser = new Core::VariableChooser(this);
|
||||
chooser->addSupportedWidget(m_nameEdit);
|
||||
chooser->addMacroExpanderProvider([this]() { return m_modifiedKit->macroExpander(); });
|
||||
|
||||
for (KitAspect *aspect : KitManager::kitAspects())
|
||||
addAspectToWorkingCopy(aspect);
|
||||
|
||||
updateVisibility();
|
||||
}
|
||||
|
||||
KitManagerConfigWidget::~KitManagerConfigWidget()
|
||||
|
@@ -46,7 +46,7 @@ class KitNode : public TreeItem
|
||||
public:
|
||||
KitNode(Kit *k)
|
||||
{
|
||||
widget = KitManager::createConfigWidget(k);
|
||||
widget = new KitManagerConfigWidget(k);
|
||||
if (widget) {
|
||||
if (k && k->isAutoDetected())
|
||||
widget->makeStickySubWidgetsReadOnly();
|
||||
|
Reference in New Issue
Block a user