summaryrefslogtreecommitdiff
path: root/src/webtab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webtab.cpp')
-rw-r--r--src/webtab.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/webtab.cpp b/src/webtab.cpp
index 02511d39..7687a957 100644
--- a/src/webtab.cpp
+++ b/src/webtab.cpp
@@ -119,9 +119,29 @@ WebPage *WebTab::page()
}
+// TODO:
+// Import the "about" check and the one in protocolhandler
+// in some (static?) methods in NewTabPage
KUrl WebTab::url()
{
- return KUrl( view()->url() );
+ KUrl u = KUrl( view()->url() );
+ if( u.scheme() == QL1S("about") )
+ {
+ QWebElement rootElement = page()->mainFrame()->documentElement();
+ if( rootElement.document().findAll("#rekonq-newtabpage").count() == 0 )
+ return u;
+ if( rootElement.findAll(".favorites").count() > 0 )
+ return KUrl("about:favorites");
+ if( rootElement.findAll(".closedTabs").count() > 0 )
+ return KUrl("about:closedTabs");
+ if( rootElement.findAll(".history").count() > 0 )
+ return KUrl("about:history");
+ if( rootElement.findAll(".bookmarks").count() > 0 )
+ return KUrl("about:bookmarks");
+ if( rootElement.findAll(".downloads").count() > 0 )
+ return KUrl("about:downloads");
+ }
+ return u;
}