From 6d9f18a4ff82fa620d35f21da32c6a7bea7f0eaf Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 24 Apr 2010 16:21:10 +0200 Subject: Detach tab. last fixes. - Do not detach one tab windows - let detach work with "about" urls --- src/webtab.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/webtab.cpp') 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; } -- cgit v1.2.1