summaryrefslogtreecommitdiff
path: root/src/protocolhandler.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-01-05 11:27:27 +0100
committerAndrea Diamantini <adjam7@gmail.com>2010-01-05 11:27:27 +0100
commite27e780aaae17724c5967186c929779d72dcbd5a (patch)
tree066e5444a67e00ee6272679d0b5410807295e25b /src/protocolhandler.cpp
parentMain toolbar (right) name & (wrong) icon (diff)
downloadrekonq-e27e780aaae17724c5967186c929779d72dcbd5a.tar.xz
Choose new tab start page
:
Diffstat (limited to 'src/protocolhandler.cpp')
-rw-r--r--src/protocolhandler.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp
index a40cc0f9..5b400582 100644
--- a/src/protocolhandler.cpp
+++ b/src/protocolhandler.cpp
@@ -26,6 +26,9 @@
// Self Includes
#include "protocolhandler.h"
+// Auto Includes
+#include "rekonq.h"
+
// Local Includes
#include "newtabpage.h"
#include "application.h"
@@ -76,6 +79,12 @@ bool ProtocolHandler::handle(const QNetworkRequest &request, QWebFrame *frame)
_url = request.url();
_frame = frame;
+ kDebug() << "URL PROTOCOL: " << _url;
+
+ // "http(s)" (fast) handling
+ if( _url.protocol() == QLatin1String("http") || _url.protocol() == QLatin1String("https") )
+ return false;
+
// "mailto" handling
if ( _url.protocol() == QLatin1String("mailto") )
{
@@ -86,11 +95,30 @@ bool ProtocolHandler::handle(const QNetworkRequest &request, QWebFrame *frame)
// "about" handling
if ( _url.protocol() == QLatin1String("about") )
{
+ 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;
+ }
+ }
if( _url == KUrl("about:closedTabs")
|| _url == KUrl("about:history")
|| _url == KUrl("about:bookmarks")
|| _url == KUrl("about:favorites")
- || _url == KUrl("about:home")
)
{
NewTabPage p(frame);