ExtensionSystem: Move Installation logic into PluginSpecs

Change-Id: I5b6d284179bf62be89d6e5157fd7e14df5e65817
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-07-25 14:46:14 +02:00
parent 2373c4c0a4
commit be2e5262c7
6 changed files with 123 additions and 63 deletions

View File

@@ -266,6 +266,21 @@ public:
Core::JsExpander::registerGlobalObject("Lua", [] { return new LuaJsExtension(); });
pluginSpecsFromArchiveFactories().push_back([](const FilePath &path) {
QList<PluginSpec *> plugins;
auto dirs = path.dirEntries(QDir::Dirs | QDir::NoDotAndDotDot);
for (const auto &dir : dirs) {
const auto specFilePath = dir / (dir.fileName() + ".lua");
if (specFilePath.exists()) {
Utils::expected_str<PluginSpec *> spec = loadPlugin(specFilePath);
QTC_CHECK_EXPECTED(spec);
if (spec)
plugins.push_back(*spec);
}
}
return plugins;
});
m_pane = new LuaPane(this);
}