| 128 | } |
| 129 | |
| 130 | void TWScriptManager::reloadScripts(bool forceAll /* = false */) |
| 131 | { |
| 132 | Tw::Settings settings; |
| 133 | QStringList disabled = settings.value(QString::fromLatin1("disabledScripts"), QStringList()).toStringList(); |
| 134 | QStringList processed; |
| 135 | |
| 136 | // canonicalize the paths |
| 137 | QDir scriptsDir(Tw::Utils::ResourcesLibrary::getLibraryPath(QStringLiteral("scripts"))); |
| 138 | for (int i = 0; i < disabled.size(); ++i) |
| 139 | disabled[i] = QFileInfo(scriptsDir.absoluteFilePath(disabled[i])).canonicalFilePath(); |
| 140 | |
| 141 | if (forceAll) |
| 142 | clear(); |
| 143 | |
| 144 | reloadScriptsInList(&m_Scripts, processed); |
| 145 | reloadScriptsInList(&m_Hooks, processed); |
| 146 | |
| 147 | addScriptsInDirectory(scriptsDir, disabled, processed); |
| 148 | |
| 149 | ScriptManagerWidget::refreshScriptList(); |
| 150 | } |
| 151 | |
| 152 | void TWScriptManager::reloadScriptsInList(TWScriptList * list, QStringList & processed) |
| 153 | { |
no test coverage detected