forked from qt-creator/qt-creator
Wizards: Better selection of project wizards to show
E.g. only show wizards that can create qmake projects when contining after a SUBDIR-project wizard. Change-Id: Ib189b1efa479f5b986fdec8658715245e2f2db40 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -203,19 +203,6 @@ private:
|
||||
NewItemDialogData s_reopenData;
|
||||
}
|
||||
|
||||
/* A utility to find all wizards supporting a view mode and matching a predicate */
|
||||
QList<IWizardFactory*> findWizardFactories(const std::function<bool(IWizardFactory*)> &predicate)
|
||||
{
|
||||
const QList<IWizardFactory *> allFactories = IWizardFactory::allWizardFactories();
|
||||
QList<IWizardFactory *> rc;
|
||||
auto cend = allFactories.constEnd();
|
||||
for (auto it = allFactories.constBegin(); it != cend; ++it) {
|
||||
if (predicate(*it))
|
||||
rc.push_back(*it);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
static Id actionId(const IWizardFactory *factory)
|
||||
{
|
||||
return factory->id().withPrefix("Wizard.Impl.");
|
||||
@@ -263,12 +250,6 @@ QList<IWizardFactory*> IWizardFactory::allWizardFactories()
|
||||
return s_allFactories;
|
||||
}
|
||||
|
||||
// Utility to find all registered wizards of a certain kind
|
||||
QList<IWizardFactory*> IWizardFactory::wizardFactoriesOfKind(WizardKind kind)
|
||||
{
|
||||
return findWizardFactories([kind](IWizardFactory *f) { return f->kind() == kind; });
|
||||
}
|
||||
|
||||
QString IWizardFactory::runPath(const QString &defaultPath)
|
||||
{
|
||||
QString path = defaultPath;
|
||||
|
||||
Reference in New Issue
Block a user