From 313314b39214c6b6c673d882dfbf3deab91007c0 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 30 Jun 2009 02:17:15 +0200 Subject: Fake gg:// and wk:// protocol. Initial Url && Search Bar (to be improved in 0.3) Trivial cleaning things here and there.. --- src/webpage.cpp | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) (limited to 'src/webpage.cpp') diff --git a/src/webpage.cpp b/src/webpage.cpp index 8c6c0d2a..133a263c 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -40,7 +40,7 @@ #include #include #include -#include + #include #include @@ -76,40 +76,6 @@ WebPage::WebPage(QObject *parent) } -bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type) -{ - - // TODO: implement ioslaves protocols - QString scheme = request.url().scheme(); - if (scheme == QLatin1String("mailto")) - { - KToolInvocation::invokeMailer(request.url()); - return false; - } - - // create convenience fake api:// protocol for KDE apidox search and Qt docs - if (scheme == QLatin1String("api")) - { - QString path; - QString className = request.url().host().toLower(); - if (className[0] == 'k') - { - path = QString("http://api.kde.org/new.classmapper.php?class=%1").arg(className); - } - else if (className[0] == 'q') - { - path = QString("http://doc.trolltech.com/4.5/%1.html").arg(className); - } - KUrl url(path); - - Application::instance()->mainWindow()->loadUrl(url); - return false; - } - - return QWebPage::acceptNavigationRequest(frame, request, type); -} - - KWebPage *WebPage::createWindow(QWebPage::WebWindowType type) { kDebug() << "creating window as new tab.. "; -- cgit v1.2.1