diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-04-24 16:21:10 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-04-24 16:21:10 +0200 |
commit | 6d9f18a4ff82fa620d35f21da32c6a7bea7f0eaf (patch) | |
tree | ccf989ddf8a4894f04eda825fcb5845358be5106 /src/webtab.cpp | |
parent | Dramatically improved "detach tab" performances.. (diff) | |
download | rekonq-6d9f18a4ff82fa620d35f21da32c6a7bea7f0eaf.tar.xz |
Detach tab. last fixes.
- Do not detach one tab windows
- let detach work with "about" urls
Diffstat (limited to 'src/webtab.cpp')
-rw-r--r-- | src/webtab.cpp | 22 |
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; } |