diff --git a/src/handlers/xdgurl.cpp b/src/handlers/xdgurl.cpp index 277f4d8cf0c85f9e05a17d9c1a2a946f82cefd49..09a449e3fe1958002823fb195f5e4ea7692df98b 100644 --- a/src/handlers/xdgurl.cpp +++ b/src/handlers/xdgurl.cpp @@ -188,12 +188,12 @@ bool XdgUrl::_uncompressArchive(const QString &path, const QString &targetDir) return false; } -bool XdgUrl::_download() +void XdgUrl::_download() { return true; } -bool XdgUrl::_install() +void XdgUrl::_install() { return true; } @@ -243,9 +243,21 @@ bool XdgUrl::isValid() return isValid; } -bool XdgUrl::process() +void XdgUrl::process() { - return true; + /** + * xdgs scheme is a reserved name, so the process of xdgs + * is the same process of the xdg scheme currently. + */ + + if (isValid()) { + if (_metadata["command"].toString() == "download") { + _download(); + } + else if (_metadata["command"].toString() == "install") { + _install(); + } + } } } // namespace Handlers diff --git a/src/handlers/xdgurl.h b/src/handlers/xdgurl.h index e89df2d3189432b701a443e4b7fd3b24bcc43e6b..340438de8e90ed211a2db7359d52c30f492089fe 100644 --- a/src/handlers/xdgurl.h +++ b/src/handlers/xdgurl.h @@ -37,8 +37,8 @@ private: QJsonObject _loadArchiveTypes(); bool _installPlasmapkg(const QString &path, const QString &type = "plasmoid"); bool _uncompressArchive(const QString &path, const QString &targetDir); - bool _download(); - bool _install(); + void _download(); + void _install(); private slots: @@ -46,7 +46,7 @@ public slots: QString getXdgUrl(); QString getMetadata(); bool isValid(); - bool process(); + void process(); signals: void downloaded(const QString &result);