forked from qt-creator/qt-creator
Make it possible to add wizards paths via plugin meta data
That makes it easy with Lua plugins, and is useful on the C++ side as well. Change-Id: I660956bed47e4c1e27a001ad8999d6701cda86ee Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -127,6 +127,7 @@ QAction *s_inspectWizardAction = nullptr;
|
||||
bool s_areFactoriesLoaded = false;
|
||||
bool s_isWizardRunning = false;
|
||||
QWidget *s_currentWizard = nullptr;
|
||||
static QSet<Id> s_plugins;
|
||||
|
||||
// NewItemDialog reopening data:
|
||||
class NewItemDialogData
|
||||
@@ -385,8 +386,7 @@ void IWizardFactory::destroyFeatureProvider()
|
||||
|
||||
void IWizardFactory::clearWizardFactories()
|
||||
{
|
||||
if (!s_areFactoriesLoaded)
|
||||
return;
|
||||
s_plugins.clear();
|
||||
|
||||
for (IWizardFactory *factory : std::as_const(s_allFactories))
|
||||
ActionManager::unregisterAction(factory->m_action, actionId(factory));
|
||||
@@ -399,16 +399,15 @@ void IWizardFactory::clearWizardFactories()
|
||||
|
||||
QSet<Id> IWizardFactory::pluginFeatures()
|
||||
{
|
||||
static QSet<Id> plugins;
|
||||
if (plugins.isEmpty()) {
|
||||
if (s_plugins.isEmpty()) {
|
||||
// Implicitly create a feature for each plugin loaded:
|
||||
const QVector<ExtensionSystem::PluginSpec *> pluginVector = ExtensionSystem::PluginManager::plugins();
|
||||
for (const ExtensionSystem::PluginSpec *s : pluginVector) {
|
||||
if (s->state() == ExtensionSystem::PluginSpec::Running)
|
||||
plugins.insert(Id::fromString(s->name()));
|
||||
s_plugins.insert(Id::fromString(s->name()));
|
||||
}
|
||||
}
|
||||
return plugins;
|
||||
return s_plugins;
|
||||
}
|
||||
|
||||
QSet<Id> IWizardFactory::availableFeatures(Id platformId)
|
||||
|
||||
Reference in New Issue
Block a user