ExtensionSystem: FilePath'ify

Change IPlugin::fileName() and IPlugin::location to use
FilePath instead of QString.

Change-Id: If473ab1e258951735f93221cbd62c505f0727eb2
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-05-07 08:33:02 +02:00
parent aad2f6ecac
commit 657ce51467
20 changed files with 79 additions and 75 deletions

View File

@@ -135,8 +135,7 @@ expected_str<void> LuaEngine::prepareSetup(
sol::lib::table,
sol::lib::utf8);
const QString searchPath
= (FilePath::fromUserInput(pluginSpec.filePath()).parentDir() / "?.lua").toUserOutput();
const QString searchPath = (pluginSpec.location() / "?.lua").toUserOutput();
lua["package"]["path"] = searchPath.toStdString();
// TODO: only register what the plugin requested

View File

@@ -62,8 +62,8 @@ public:
bool delayedInitialize() final
{
scanForPlugins(transform(PluginManager::pluginPaths(), [](const QString &path) -> FilePath {
return FilePath::fromUserInput(path) / "lua-plugins";
scanForPlugins(transform(PluginManager::pluginPaths(), [](const FilePath &path) {
return path / "lua-plugins";
}));
return true;

View File

@@ -71,8 +71,8 @@ expected_str<LuaPluginSpec *> LuaPluginSpec::create(const FilePath &filePath,
if (!r)
return make_unexpected(r.error());
pluginSpec->setFilePath(filePath.toUserOutput());
pluginSpec->setLocation(filePath.parentDir().toUserOutput());
pluginSpec->setFilePath(filePath);
pluginSpec->setLocation(filePath.parentDir());
pluginSpec->d->pluginScriptPath = filePath;