forked from qt-creator/qt-creator
StudioWelcome: Ensure only wizards with the QtSudio feature are shown
This is is easiest way to hide all unrelated wizards and we do not have to maintain any list. Change-Id: Id3f3b710b670cbe4e670d9dd86526daecab3fa9b Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -30,11 +30,6 @@
|
|||||||
#include "wizardfactories.h"
|
#include "wizardfactories.h"
|
||||||
#include <qmldesigner/components/componentcore/theme.h>
|
#include <qmldesigner/components/componentcore/theme.h>
|
||||||
|
|
||||||
namespace {
|
|
||||||
// TODO: should be extern, check coreplugin/dialogs/newdialogwidget.cpp
|
|
||||||
const char BLACKLISTED_CATEGORIES_KEY[] = "Core/NewDialog/BlacklistedCategories";
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace StudioWelcome;
|
using namespace StudioWelcome;
|
||||||
|
|
||||||
WizardFactories::WizardFactories(QList<Core::IWizardFactory *> &factories, QWidget *wizardParent, const Utils::Id &platform)
|
WizardFactories::WizardFactories(QList<Core::IWizardFactory *> &factories, QWidget *wizardParent, const Utils::Id &platform)
|
||||||
@@ -42,9 +37,6 @@ WizardFactories::WizardFactories(QList<Core::IWizardFactory *> &factories, QWidg
|
|||||||
, m_platform{platform}
|
, m_platform{platform}
|
||||||
, m_factories{factories}
|
, m_factories{factories}
|
||||||
{
|
{
|
||||||
QVariant value = Core::ICore::settings()->value(BLACKLISTED_CATEGORIES_KEY);
|
|
||||||
m_blacklist = Utils::Id::fromStringList(value.toStringList());
|
|
||||||
|
|
||||||
sortByCategoryAndId();
|
sortByCategoryAndId();
|
||||||
filter();
|
filter();
|
||||||
m_projectItems = makeProjectItemsGroupedByCategory();
|
m_projectItems = makeProjectItemsGroupedByCategory();
|
||||||
@@ -68,7 +60,7 @@ void WizardFactories::filter()
|
|||||||
[&](auto *wizard) {
|
[&](auto *wizard) {
|
||||||
return wizard->isAvailable(m_platform)
|
return wizard->isAvailable(m_platform)
|
||||||
&& wizard->kind() == Core::IWizardFactory::ProjectWizard
|
&& wizard->kind() == Core::IWizardFactory::ProjectWizard
|
||||||
&& !m_blacklist.contains(Utils::Id::fromString(wizard->category()));
|
&& wizard->requiredFeatures().contains("QtStudio");
|
||||||
});
|
});
|
||||||
|
|
||||||
m_factories = acceptedFactories;
|
m_factories = acceptedFactories;
|
||||||
|
@@ -55,7 +55,6 @@ private:
|
|||||||
std::map<QString, ProjectCategory> makeProjectItemsGroupedByCategory();
|
std::map<QString, ProjectCategory> makeProjectItemsGroupedByCategory();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSet<Utils::Id> m_blacklist;
|
|
||||||
QWidget *m_wizardParent;
|
QWidget *m_wizardParent;
|
||||||
Utils::Id m_platform;
|
Utils::Id m_platform;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user