summaryrefslogtreecommitdiff
path: root/src/webtab.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-04-24 16:22:02 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-04-24 16:22:02 +0200
commitddd86a17a26b88fe39df17459bef587aa22a16d3 (patch)
treef2327733717a5a149f68e17daee540f529f32d64 /src/webtab.cpp
parentNew dns prefetch webkit property and updated local storage one (diff)
parentDetach tab. last fixes. (diff)
downloadrekonq-ddd86a17a26b88fe39df17459bef587aa22a16d3.tar.xz
Merge branch 'DETACH_TAB'
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 62de6299..bc051e27 100644
--- a/src/webtab.cpp
+++ b/src/webtab.cpp
@@ -118,9 +118,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;
}