Lua: Add test scripts

Change-Id: I03cb69289151f44db6836ad0be6d2091d9c853bc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-10-15 14:38:46 +02:00
parent ed609dbb45
commit 3f7e8f43b7
6 changed files with 100 additions and 3 deletions

View File

@@ -426,10 +426,17 @@ public:
void scanForScripts()
{
const FilePath scriptsPath = Core::ICore::userResourcePath("scripts");
if (!scriptsPath.exists())
return;
const FilePath userScriptsPath = Core::ICore::userResourcePath("scripts");
if (userScriptsPath.exists())
scanForScriptsIn(userScriptsPath);
const FilePath scriptsPath = Core::ICore::resourcePath("lua/scripts");
if (scriptsPath.exists())
scanForScriptsIn(scriptsPath);
}
void scanForScriptsIn(const FilePath &scriptsPath)
{
ActionContainer *scriptContainer = ActionManager::actionContainer(M_SCRIPT);
const FilePaths scripts = scriptsPath.dirEntries(FileFilter({"*.lua"}, QDir::Files));