| 126 | } |
| 127 | |
| 128 | void UserScriptManager::installScript(const QUrl &url) |
| 129 | { |
| 130 | if (!url.isValid()) |
| 131 | return; |
| 132 | |
| 133 | QNetworkRequest request; |
| 134 | request.setUrl(url); |
| 135 | |
| 136 | DownloadManager *downloadMgr = sBrowserApplication->getDownloadManager(); |
| 137 | InternalDownloadItem *item = downloadMgr->downloadInternal(request, m_model->m_userScriptDir, false); |
| 138 | connect(item, &InternalDownloadItem::downloadFinished, [=](const QString &filePath){ |
| 139 | UserScript script; |
| 140 | if (script.load(filePath, m_model->m_scriptTemplate)) |
| 141 | m_model->addScript(std::move(script)); |
| 142 | }); |
| 143 | } |
| 144 | |
| 145 | void UserScriptManager::createScript(const QString &name, const QString &nameSpace, const QString &description, const QString &version) |
| 146 | { |
no test coverage detected