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

Method removeScript

src/plugins/GreaseMonkey/gm_manager.cpp:270–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270bool GM_Manager::removeScript(GM_Script* script, const bool removeFile)
271{
272 if (!script) {
273 return false;
274 }
275
276 m_scripts.removeOne(script);
277
278 if (script->startAt() == GM_Script::ContextMenu) {
279 m_contextMenuScripts.removeOne(script);
280 }
281 else {
282 QWebEngineScriptCollection *collection = mApp->webProfile()->scripts();
283 const auto scripts = collection->find(script->fullName());
284 for (const auto &script : scripts) {
285 collection->remove(script);
286 }
287 }
288
289 m_disabledScripts.removeOne(script->fullName());
290
291 if (removeFile) {
292 QFile::remove(script->fileName());
293 delete script;
294 }
295
296 Q_EMIT scriptsChanged();
297 return true;
298}
299
300void GM_Manager::showNotification(const QString &message, const QString &title)
301{

Callers 2

reloadScriptMethod · 0.80
removeItemMethod · 0.80

Calls 7

removeFunction · 0.85
startAtMethod · 0.80
webProfileMethod · 0.80
findMethod · 0.80
fullNameMethod · 0.80
removeMethod · 0.45
fileNameMethod · 0.45

Tested by

no test coverage detected