MCPcopy Create free account
hub / github.com/KDE/falkon / addScript

Method addScript

src/plugins/GreaseMonkey/gm_manager.cpp:249–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249bool GM_Manager::addScript(GM_Script* script)
250{
251 if (!script || !script->isValid()) {
252 return false;
253 }
254
255 m_scripts.append(script);
256 connect(script, &GM_Script::scriptChanged, this, &GM_Manager::scriptChanged);
257
258 if (script->startAt() == GM_Script::ContextMenu) {
259 m_contextMenuScripts.append(script);
260 }
261 else if (isEnabled()) {
262 QWebEngineScriptCollection *collection = mApp->webProfile()->scripts();
263 collection->insert(script->webScript());
264 }
265
266 Q_EMIT scriptsChanged();
267 return true;
268}
269
270bool GM_Manager::removeScript(GM_Script* script, const bool removeFile)
271{

Callers 4

acceptedMethod · 0.80
installScriptMethod · 0.80
reloadScriptMethod · 0.80
newScriptMethod · 0.80

Calls 5

startAtMethod · 0.80
webProfileMethod · 0.80
insertMethod · 0.80
webScriptMethod · 0.80
isValidMethod · 0.45

Tested by

no test coverage detected