MCPcopy Create free account
hub / github.com/MrKepzie/Natron / findAllScriptsRecursive

Method findAllScriptsRecursive

Engine/AppManager.cpp:1877–1913  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1875}
1876
1877void
1878AppManager::findAllScriptsRecursive(const QDir& directory,
1879 QStringList& allPlugins,
1880 QStringList *foundInit,
1881 QStringList *foundInitGui)
1882{
1883 if ( !directory.exists() ) {
1884 return;
1885 }
1886
1887 QStringList filters;
1888 filters << QString::fromUtf8("*.py");
1889 QStringList files = directory.entryList(filters, QDir::Files | QDir::NoDotAndDotDot);
1890 bool ok = findAndRunScriptFile( directory.absolutePath() + QChar::fromLatin1('/'), files, QString::fromUtf8("init.py") );
1891 if (ok) {
1892 foundInit->append( directory.absolutePath() + QString::fromUtf8("/init.py") );
1893 }
1894 if ( !appPTR->isBackground() ) {
1895 ok = findAndRunScriptFile( directory.absolutePath() + QChar::fromLatin1('/'), files, QString::fromUtf8("initGui.py") );
1896 if (ok) {
1897 foundInitGui->append( directory.absolutePath() + QString::fromUtf8("/initGui.py") );
1898 }
1899 }
1900
1901 for (QStringList::iterator it = files.begin(); it != files.end(); ++it) {
1902 if ( it->endsWith( QString::fromUtf8(".py") ) && ( *it != QString::fromUtf8("init.py") ) && ( *it != QString::fromUtf8("initGui.py") ) ) {
1903 allPlugins.push_back(directory.absolutePath() + QChar::fromLatin1('/') + *it);
1904 }
1905 }
1906
1907 QStringList subDirs = directory.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
1908 Q_FOREACH(const QString &subDir, subDirs) {
1909 QDir d(directory.absolutePath() + QChar::fromLatin1('/') + subDir);
1910
1911 findAllScriptsRecursive(d, allPlugins, foundInit, foundInitGui);
1912 }
1913}
1914
1915void
1916AppManager::loadPythonGroups()

Callers

nothing calls this directly

Calls 6

absolutePathMethod · 0.80
appendMethod · 0.80
isBackgroundMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected