| 1875 | } |
| 1876 | |
| 1877 | void |
| 1878 | AppManager::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 | |
| 1915 | void |
| 1916 | AppManager::loadPythonGroups() |
nothing calls this directly
no test coverage detected