|
|
|
@ -138,8 +138,8 @@ void GM_Manager::enableScript(GM_Script* script) |
|
|
|
script->setEnabled(true); |
|
|
|
script->setEnabled(true); |
|
|
|
m_disabledScripts.removeOne(script->fullName()); |
|
|
|
m_disabledScripts.removeOne(script->fullName()); |
|
|
|
|
|
|
|
|
|
|
|
QWebEngineScriptCollection &collection = mApp->webProfile()->scripts(); |
|
|
|
QWebEngineScriptCollection *collection = mApp->webProfile()->scripts(); |
|
|
|
collection.insert(script->webScript()); |
|
|
|
collection->insert(script->webScript()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void GM_Manager::disableScript(GM_Script* script) |
|
|
|
void GM_Manager::disableScript(GM_Script* script) |
|
|
|
@ -147,8 +147,8 @@ void GM_Manager::disableScript(GM_Script* script) |
|
|
|
script->setEnabled(false); |
|
|
|
script->setEnabled(false); |
|
|
|
m_disabledScripts.append(script->fullName()); |
|
|
|
m_disabledScripts.append(script->fullName()); |
|
|
|
|
|
|
|
|
|
|
|
QWebEngineScriptCollection &collection = mApp->webProfile()->scripts(); |
|
|
|
QWebEngineScriptCollection *collection = mApp->webProfile()->scripts(); |
|
|
|
collection.remove(collection.findScript(script->fullName())); |
|
|
|
collection->remove(collection->findScript(script->fullName())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool GM_Manager::addScript(GM_Script* script) |
|
|
|
bool GM_Manager::addScript(GM_Script* script) |
|
|
|
@ -160,8 +160,8 @@ bool GM_Manager::addScript(GM_Script* script) |
|
|
|
m_scripts.append(script); |
|
|
|
m_scripts.append(script); |
|
|
|
connect(script, &GM_Script::scriptChanged, this, &GM_Manager::scriptChanged); |
|
|
|
connect(script, &GM_Script::scriptChanged, this, &GM_Manager::scriptChanged); |
|
|
|
|
|
|
|
|
|
|
|
QWebEngineScriptCollection &collection = mApp->webProfile()->scripts(); |
|
|
|
QWebEngineScriptCollection *collection = mApp->webProfile()->scripts(); |
|
|
|
collection.insert(script->webScript()); |
|
|
|
collection->insert(script->webScript()); |
|
|
|
|
|
|
|
|
|
|
|
emit scriptsChanged(); |
|
|
|
emit scriptsChanged(); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
@ -175,8 +175,8 @@ bool GM_Manager::removeScript(GM_Script* script, bool removeFile) |
|
|
|
|
|
|
|
|
|
|
|
m_scripts.removeOne(script); |
|
|
|
m_scripts.removeOne(script); |
|
|
|
|
|
|
|
|
|
|
|
QWebEngineScriptCollection &collection = mApp->webProfile()->scripts(); |
|
|
|
QWebEngineScriptCollection *collection = mApp->webProfile()->scripts(); |
|
|
|
collection.remove(collection.findScript(script->fullName())); |
|
|
|
collection->remove(collection->findScript(script->fullName())); |
|
|
|
|
|
|
|
|
|
|
|
m_disabledScripts.removeOne(script->fullName()); |
|
|
|
m_disabledScripts.removeOne(script->fullName()); |
|
|
|
|
|
|
|
|
|
|
|
@ -229,7 +229,7 @@ void GM_Manager::load() |
|
|
|
script->setEnabled(false); |
|
|
|
script->setEnabled(false); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
mApp->webProfile()->scripts().insert(script->webScript()); |
|
|
|
mApp->webProfile()->scripts()->insert(script->webScript()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -242,9 +242,9 @@ void GM_Manager::scriptChanged() |
|
|
|
if (!script) |
|
|
|
if (!script) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
QWebEngineScriptCollection &collection = mApp->webProfile()->scripts(); |
|
|
|
QWebEngineScriptCollection *collection = mApp->webProfile()->scripts(); |
|
|
|
collection.remove(collection.findScript(script->fullName())); |
|
|
|
collection->remove(collection->findScript(script->fullName())); |
|
|
|
collection.insert(script->webScript()); |
|
|
|
collection->insert(script->webScript()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool GM_Manager::canRunOnScheme(const QString &scheme) |
|
|
|
bool GM_Manager::canRunOnScheme(const QString &scheme) |
|
|
|
|