From cd0f7e0a883472b3183320b43bab0e04c07d4aaf Mon Sep 17 00:00:00 2001 From: megabigbug Date: Sat, 17 Oct 2009 14:04:09 +0200 Subject: reintroduce and fix recently closed tab feature --- src/homepage.cpp | 52 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) (limited to 'src/homepage.cpp') diff --git a/src/homepage.cpp b/src/homepage.cpp index 4735315a..fabb2a91 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -75,10 +75,10 @@ QString HomePage::rekonqHomePage(const KUrl &url) QString speed; QString title; - if(url == KUrl("rekonq:allTabs")) + if(url == KUrl("rekonq:closedTabs")) { - speed = fillAllTabs(); - title = i18n("All Tabs"); + speed = fillClosedTabs(); + title = i18n("Closed Tabs"); } if(url == KUrl("rekonq:history")) { @@ -170,11 +170,11 @@ QString HomePage::homePageMenu(KUrl currentUrl) menu += ""; menu += "
"; - menu += "iconPath("tab-duplicate", KIconLoader::Desktop) + "\" />"; - menu += i18n("All Tabs"); + menu += "\">"; + menu += "iconPath("tab-close", KIconLoader::Desktop) + "\" />"; + menu += i18n("Closed Tabs"); menu += "
"; menu += "
mainWindow()->mainView()->recentlyClosedTabs(); + QString closed; - MainView *mv = Application::instance()->mainWindow()->mainView(); - for (int i = 0 ; i < mv->count() -1 ; i++) + Q_FOREACH( const KUrl &url, links) { - QString urlString = mv->webView(i)->url().toEncoded(QUrl::StripTrailingSlash); - QString title = mv->webView(i)->title(); - - if(title.length() > 20) + QString text = url.prettyUrl(); + if(text.length() > 20) { - title.truncate(17); - title += "..."; + text.truncate(17); + text += "..."; } - tabs += "
"; - tabs += ""; - tabs += ""; - tabs += ""; - tabs += "
"; - tabs += "" + title + "
"; - } - - return tabs; + + closed += "
"; + closed += ""; + closed += ""; + closed += "
"; + closed += "" + text + "
"; + } + + return closed; } -- cgit v1.2.1