summaryrefslogtreecommitdiff
path: root/src/homepage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/homepage.cpp')
-rw-r--r--src/homepage.cpp67
1 files changed, 25 insertions, 42 deletions
diff --git a/src/homepage.cpp b/src/homepage.cpp
index 79345556..835be043 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"))
{
@@ -115,26 +115,20 @@ QString HomePage::fillFavorites()
QString speed;
for(int i=0; i<8; ++i)
{
- QString text = names.at(i);
- if(text.length() > 20)
- {
- text.truncate(17);
- text += "...";
- }
speed += "<div class=\"thumbnail\">";
- speed += "<object type=\"application/image-preview\" data=\"";
- speed += urls.at(i) + "\" width=\"200\">";
+ speed += "<object type=\"application/image-preview\" data=\"" + urls.at(i) + "\" >";
+ speed += "<param name=\"title\" value=\"" + names.at(i) + "\" />";
speed += "<param name=\"index\" value=\"" + QString::number(i) + "\" />";
speed += "<param name=\"isFavorite\" value=\"true\" />";
speed += "</object>";
- speed += "<br />";
- speed += "<a href=\"" + urls.at(i) + "\">" + text + "</a></div>";
+ speed += "</div>";
}
return speed;
}
+// FIXME : port to new PreviewImage API to use...
QString HomePage::lastVisitedSites()
{
QString last;
@@ -143,11 +137,10 @@ QString HomePage::lastVisitedSites()
{
HistoryItem it = history.at(i);
last += "<div class=\"thumbnail\">";
- last += "<object type=\"application/image-preview\" data=\"" + it.url;
- last += "\" width=\"200\">";
+ last += "<object type=\"application/image-preview\" data=\"" + it.url + "\" >";
last += "</object>";
last += "<br />";
- last += "<a href=\"" + it.url + "\">" + it.url + "</a></div>";
+ last += "<a href=\"" + it.url + "\">" + it.title + "</a></div>";
}
return last;
@@ -170,11 +163,11 @@ QString HomePage::homePageMenu(KUrl currentUrl)
menu += "</a></div>";
menu += "<div class=\"link";
- if(currentUrl == "rekonq:allTabs")
+ if(currentUrl == "rekonq:closedTabs")
menu += " current";
- menu += "\"><a href=\"rekonq:allTabs\">";
- menu += "<img src=\"file:///" + loader->iconPath("tab-duplicate", KIconLoader::Desktop || KIconLoader::SizeSmall) + "\" />";
- menu += i18n("All Tabs");
+ menu += "\"><a href=\"rekonq:closedTabs\">";
+ menu += "<img src=\"file:///" + loader->iconPath("tab-close", KIconLoader::Desktop || KIconLoader::SizeSmall) + "\" />";
+ menu += i18n("Closed Tabs");
menu += "</a></div>";
menu += "<div class=\"link";
@@ -276,29 +269,19 @@ QString HomePage::createBookItem(const KBookmark &bookmark)
}
-QString HomePage::fillAllTabs()
+QString HomePage::fillClosedTabs()
{
- QString tabs;
+ QList<HistoryItem> links = Application::instance()->mainWindow()->mainView()->recentlyClosedTabs();
+ QString closed;
- MainView *mv = Application::instance()->mainWindow()->mainView();
- for (int i = 0 ; i < mv->count() -1 ; i++)
+ Q_FOREACH( const HistoryItem &item, links)
{
- QString urlString = mv->webView(i)->url().toEncoded(QUrl::StripTrailingSlash);
- QString title = mv->webView(i)->title();
-
- if(title.length() > 20)
- {
- title.truncate(17);
- title += "...";
- }
- tabs += "<div class=\"thumbnail\">";
- tabs += "<object type=\"application/image-preview\" data=\"";
- tabs += urlString + "\" width=\"200\">";
- tabs += "<param name=\"index\" value=\"" + QString::number(i) + "\" />";
- tabs += "</object>";
- tabs += "<br />";
- tabs += "<a href=\"" + urlString + "\">" + title + "</a></div>";
- }
-
- return tabs;
+ closed += "<div class=\"thumbnail\">";
+ closed += "<object type=\"application/image-preview\" data=\"" + item.url + "\" >";
+ closed += "<param name=\"title\" value=\"" + item.title + "\" />";
+ closed += "</object>";
+ closed += "</div>";
+ }
+
+ return closed;
}