| 1796 | } |
| 1797 | |
| 1798 | void |
| 1799 | AppManager::findAllScriptsRecursive(const QDir& directory, |
| 1800 | QStringList& allPlugins, |
| 1801 | QStringList *foundInit, |
| 1802 | QStringList *foundInitGui) |
| 1803 | { |
| 1804 | if ( !directory.exists() ) { |
| 1805 | return; |
| 1806 | } |
| 1807 | |
| 1808 | QStringList filters; |
| 1809 | filters << QString::fromUtf8("*.py"); |
| 1810 | QStringList files = directory.entryList(filters, QDir::Files | QDir::NoDotAndDotDot); |
| 1811 | bool ok = findAndRunScriptFile( directory.absolutePath() + QChar::fromLatin1('/'), files, QString::fromUtf8("init.py") ); |
| 1812 | if (ok) { |
| 1813 | foundInit->append( directory.absolutePath() + QString::fromUtf8("/init.py") ); |
| 1814 | } |
| 1815 | if ( !appPTR->isBackground() ) { |
| 1816 | ok = findAndRunScriptFile( directory.absolutePath() + QChar::fromLatin1('/'), files, QString::fromUtf8("initGui.py") ); |
| 1817 | if (ok) { |
| 1818 | foundInitGui->append( directory.absolutePath() + QString::fromUtf8("/initGui.py") ); |
| 1819 | } |
| 1820 | } |
| 1821 | |
| 1822 | for (QStringList::iterator it = files.begin(); it != files.end(); ++it) { |
| 1823 | if ( it->endsWith( QString::fromUtf8(".py") ) && ( *it != QString::fromUtf8("init.py") ) && ( *it != QString::fromUtf8("initGui.py") ) ) { |
| 1824 | allPlugins.push_back(directory.absolutePath() + QChar::fromLatin1('/') + *it); |
| 1825 | } |
| 1826 | } |
| 1827 | |
| 1828 | QStringList subDirs = directory.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); |
| 1829 | Q_FOREACH(const QString &subDir, subDirs) { |
| 1830 | QDir d(directory.absolutePath() + QChar::fromLatin1('/') + subDir); |
| 1831 | |
| 1832 | findAllScriptsRecursive(d, allPlugins, foundInit, foundInitGui); |
| 1833 | } |
| 1834 | } |
| 1835 | |
| 1836 | void |
| 1837 | AppManager::loadPythonGroups() |
nothing calls this directly
no test coverage detected