Skip to content
Snippets Groups Projects
Commit 7e6701db authored by akiraohgaki's avatar akiraohgaki
Browse files

Process

parent 3b42a65a
No related branches found
No related tags found
No related merge requests found
...@@ -188,12 +188,12 @@ bool XdgUrl::_uncompressArchive(const QString &path, const QString &targetDir) ...@@ -188,12 +188,12 @@ bool XdgUrl::_uncompressArchive(const QString &path, const QString &targetDir)
return false; return false;
} }
bool XdgUrl::_download() void XdgUrl::_download()
{ {
return true; return true;
} }
bool XdgUrl::_install() void XdgUrl::_install()
{ {
return true; return true;
} }
...@@ -243,9 +243,21 @@ bool XdgUrl::isValid() ...@@ -243,9 +243,21 @@ bool XdgUrl::isValid()
return 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 } // namespace Handlers
...@@ -37,8 +37,8 @@ private: ...@@ -37,8 +37,8 @@ private:
QJsonObject _loadArchiveTypes(); QJsonObject _loadArchiveTypes();
bool _installPlasmapkg(const QString &path, const QString &type = "plasmoid"); bool _installPlasmapkg(const QString &path, const QString &type = "plasmoid");
bool _uncompressArchive(const QString &path, const QString &targetDir); bool _uncompressArchive(const QString &path, const QString &targetDir);
bool _download(); void _download();
bool _install(); void _install();
private slots: private slots:
...@@ -46,7 +46,7 @@ public slots: ...@@ -46,7 +46,7 @@ public slots:
QString getXdgUrl(); QString getXdgUrl();
QString getMetadata(); QString getMetadata();
bool isValid(); bool isValid();
bool process(); void process();
signals: signals:
void downloaded(const QString &result); void downloaded(const QString &result);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment