MCPcopy Create free account
hub / github.com/TeXworks/texworks / reloadScripts

Method reloadScripts

src/TWScriptManager.cpp:130–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130void 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
152void TWScriptManager::reloadScriptsInList(TWScriptList * list, QStringList & processed)
153{

Callers 1

updateScriptsListMethod · 0.80

Calls 2

valueMethod · 0.45
absoluteFilePathMethod · 0.45

Tested by

no test coverage detected