summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Tröscher <fritz_van_tom@hotmail.com>2011-09-16 15:49:38 +0200
committerJohannes Tröscher <fritz_van_tom@hotmail.com>2011-09-16 15:49:38 +0200
commit4c3bc1deb42f9106aac7e6d9fa1078fe218c0075 (patch)
tree60f1f77e6424991b0ffac4005a0e402af63c69c7 /src
parentGet sure page is extant before searching for DOM elements there (diff)
downloadrekonq-4c3bc1deb42f9106aac7e6d9fa1078fe218c0075.tar.xz
Search with default searchEngine in errorPage
REVIEW: 102592 REVIEWED-BY: adjam
Diffstat (limited to 'src')
-rw-r--r--src/webpage.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 1119d4b6..17d791c4 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -49,6 +49,7 @@
#include "urlbar.h"
#include "webpluginfactory.h"
#include "webtab.h"
+#include "searchengine.h"
#include "sslwidget.h"
#include "sslinfodialog.h"
@@ -658,6 +659,16 @@ QString WebPage::errorPage(QNetworkReply *reply)
msg += QL1S("<input type=\"button\" id=\"reloadButton\" onClick=\"document.location.href='") + urlString + QL1S("';\" value=\"");
msg += i18n("Try Again") + QL1S("\" />");
+ //Default SearchEngine
+ KService::Ptr defaultEngine = SearchEngine::defaultEngine();
+
+ if (defaultEngine)
+ {
+ msg += i18n("or");
+ msg += QL1S(" <a href=\"") + SearchEngine::buildQuery(defaultEngine, urlString) + QL1S("\">");
+ msg += i18n("Search with %1", defaultEngine->name()) + QL1S("</a>");
+ }
+
QString html = QString(QL1S(file.readAll()))
.arg(title)
.arg(msg)