diff --git a/src/handlers/xdgurl.cpp b/src/handlers/xdgurl.cpp index b51ddd3e6d57e33495a74a46ce6a513fd9a20e57..96790ab0718e72a468422c11a338b017905c4a78 100644 --- a/src/handlers/xdgurl.cpp +++ b/src/handlers/xdgurl.cpp @@ -58,6 +58,21 @@ QJsonObject XdgUrl::_parse() return meta; } +QString XdgUrl::_convertPathString(const QString &path) +{ + QString newPath = path; + if (newPath.contains("$HOME")) { + newPath.replace("$HOME", Utility::File::homePath()); + } + else if (newPath.contains("$XDG_DATA")) { + newPath.replace("$XDG_DATA", Utility::File::xdgDataHomePath()); + } + else if (newPath.contains("$KDE_DATA")) { + newPath.replace("$KDE_DATA", Utility::File::kdeDataHomePath()); + } + return newPath; +} + QJsonObject XdgUrl::_importDestinations() { QJsonObject destinations; diff --git a/src/handlers/xdgurl.h b/src/handlers/xdgurl.h index 6a94f508777cfbea6c7eecd360de74688e000415..03001b5f19e4dc18d91c68c4a3c629638ed1a68a 100644 --- a/src/handlers/xdgurl.h +++ b/src/handlers/xdgurl.h @@ -32,6 +32,7 @@ public: private: QJsonObject _parse(); + QString _convertPathString(const QString &path); QJsonObject _importDestinations(); QJsonObject _importArchiveTypes(); bool _installPlasmapkg(const QString &path, const QString &type = "plasmoid");