summaryrefslogtreecommitdiff
path: root/src/protocolhandler.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-02-18 02:10:51 +0100
committerAndrea Diamantini <adjam7@gmail.com>2010-02-18 02:10:51 +0100
commit4dcd02b5317896be0adbe479a4594dac4f048286 (patch)
tree2fd44aeae0e9a60ec4df3b50ef4f5dc090db983b /src/protocolhandler.cpp
parentPlease, don't crash on CTRL+W signals :) (diff)
downloadrekonq-4dcd02b5317896be0adbe479a4594dac4f048286.tar.xz
Working around about: protocol..
- honor rekonq settings on about:home page - loads about:blank :) pages
Diffstat (limited to 'src/protocolhandler.cpp')
-rw-r--r--src/protocolhandler.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp
index af2e9904..a80f0a46 100644
--- a/src/protocolhandler.cpp
+++ b/src/protocolhandler.cpp
@@ -108,6 +108,33 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra
// "about" handling
if ( _url.protocol() == QLatin1String("about") )
{
+ if( _url == KUrl("about:blank") )
+ {
+ frame->setHtml( QString() );
+ return true;
+ }
+
+ if( _url == KUrl("about:home") )
+ {
+ switch(ReKonfig::newTabStartPage())
+ {
+ case 0: // favorites
+ _url = KUrl("about:favorites");
+ break;
+ case 1: // closed tabs
+ _url = KUrl("about:closedTabs");
+ break;
+ case 2: // history
+ _url = KUrl("about:history");
+ break;
+ case 3: // bookmarks
+ _url = KUrl("about:bookmarks");
+ break;
+ default: // unuseful
+ break;
+ }
+ }
+
NewTabPage p(frame);
p.generate(_url);
return true;
@@ -149,7 +176,7 @@ bool ProtocolHandler::postHandling(const QNetworkRequest &request, QWebFrame *fr
}
// "file" handling. This is quite trivial :)
- if(_url.protocol() == QLatin1String("file") )
+ if( _url.protocol() == QLatin1String("file") )
{
QFileInfo fileInfo( _url.path() );
if(fileInfo.isDir())