forked from qt-creator/qt-creator
ExtensionSystem: Add support for static plugins
Loads all plugins that are known via Q_IMPORT_PLUGIN() Change-Id: I3c1fe223ce6e4dcdb7729f5ab3e782e78bca5afc Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -1694,11 +1694,20 @@ void PluginManagerPrivate::readPluginPaths()
|
||||
// default
|
||||
pluginCategories.insert(QString(), QVector<PluginSpec *>());
|
||||
|
||||
// from the file system
|
||||
for (const QString &pluginFile : pluginFiles(pluginPaths)) {
|
||||
PluginSpec *spec = PluginSpec::read(pluginFile);
|
||||
if (!spec) // not a Qt Creator plugin
|
||||
continue;
|
||||
if (spec) // Qt Creator plugin
|
||||
pluginSpecs.append(spec);
|
||||
}
|
||||
// static
|
||||
for (const QStaticPlugin &plugin : QPluginLoader::staticPlugins()) {
|
||||
PluginSpec *spec = PluginSpec::read(plugin);
|
||||
if (spec) // Qt Creator plugin
|
||||
pluginSpecs.append(spec);
|
||||
}
|
||||
|
||||
for (PluginSpec *spec : pluginSpecs) {
|
||||
// defaultDisabledPlugins and defaultEnabledPlugins from install settings
|
||||
// is used to override the defaults read from the plugin spec
|
||||
if (spec->isEnabledByDefault() && defaultDisabledPlugins.contains(spec->name())) {
|
||||
@@ -1714,7 +1723,6 @@ void PluginManagerPrivate::readPluginPaths()
|
||||
spec->d->setEnabledBySettings(false);
|
||||
|
||||
pluginCategories[spec->category()].append(spec);
|
||||
pluginSpecs.append(spec);
|
||||
}
|
||||
resolveDependencies();
|
||||
enableDependenciesIndirectly();
|
||||
|
||||
Reference in New Issue
Block a user