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

Method downloadScript

src/plugins/GreaseMonkey/gm_manager.cpp:66–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66void GM_Manager::downloadScript(const QUrl &url)
67{
68 auto *downloader = new GM_Downloader(url, this);
69 connect(downloader, &GM_Downloader::finished, this, [=](const QString &fileName) {
70 bool deleteScript = true;
71 auto *script = new GM_Script(this, fileName);
72 if (script->isValid()) {
73 if (!containsScript(script->fullName())) {
74 GM_AddScriptDialog dialog(this, script);
75 deleteScript = dialog.exec() != QDialog::Accepted;
76 }
77 else {
78 showNotification(tr("'%1' is already installed").arg(script->name()));
79 }
80 }
81
82 if (deleteScript) {
83 delete script;
84 QFile(fileName).remove();
85 }
86 });
87}
88
89QString GM_Manager::settingsPath() const
90{

Callers 1

Calls 5

fullNameMethod · 0.80
execMethod · 0.80
isValidMethod · 0.45
nameMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected