diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2013-03-16 15:07:54 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2013-03-17 11:35:20 +0100 |
commit | 6ddb1b2a0fb39c758c975652b242bbfa8feaea57 (patch) | |
tree | accd70bbbe38cf26a405ac3c4b3634deab71fc5d /src/webtab | |
parent | open url as webapp option (diff) | |
download | rekonq-6ddb1b2a0fb39c758c975652b242bbfa8feaea57.tar.xz |
Support "open in webapp" && "install webapp" links
And now... :D
Diffstat (limited to 'src/webtab')
-rw-r--r-- | src/webtab/protocolhandler.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/webtab/protocolhandler.cpp b/src/webtab/protocolhandler.cpp index e9f6a77c..4b456112 100644 --- a/src/webtab/protocolhandler.cpp +++ b/src/webtab/protocolhandler.cpp @@ -31,7 +31,10 @@ #include "rekonq.h" // Local Includes +#include "application.h" + #include "historymanager.h" + #include "webpage.h" #include "webtab.h" #include "urlbar.h" @@ -142,6 +145,26 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra return false; } + kDebug() << "FN: " << _url.fileName(); + kDebug() << "DIR: " << _url.directory(); + + if (_url.directory() == QL1S("webapp")) + { + if (_url.fileName() == QL1S("launch")) + { + QString value = _url.queryItemValue(QL1S("url")); + rApp->loadUrl(KUrl(value), Rekonq::WebApp); + return true; + } + if (_url.fileName() == QL1S("install")) + { + QString urlValue = _url.queryItemValue(QL1S("url")); + QString titleValue = _url.queryItemValue(QL1S("title")); + rApp->createWebAppShortcut(urlValue, titleValue); + return true; + } + } + if (encodedUrl == QByteArray("about:home")) { switch (ReKonfig::newTabStartPage()) |