diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-06-30 02:17:15 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-06-30 02:17:15 +0200 |
commit | 313314b39214c6b6c673d882dfbf3deab91007c0 (patch) | |
tree | 2d8c2bc503c4f5b1bb75d8c8cc628c7125f257f7 /src/webpage.cpp | |
parent | Fixing silly conditions on CMakeLists KDE version (diff) | |
download | rekonq-313314b39214c6b6c673d882dfbf3deab91007c0.tar.xz |
Fake gg:// and wk:// protocol.
Initial Url && Search Bar (to be improved in 0.3)
Trivial cleaning things here and there..
Diffstat (limited to 'src/webpage.cpp')
-rw-r--r-- | src/webpage.cpp | 36 |
1 files changed, 1 insertions, 35 deletions
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 <KUrl> #include <KActionCollection> #include <KDebug> -#include <KToolInvocation> + #include <KDE/KParts/BrowserRun> #include <KDE/KMimeTypeTrader> @@ -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.. "; |