diff options
Diffstat (limited to 'src/homepage.cpp')
-rw-r--r-- | src/homepage.cpp | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/src/homepage.cpp b/src/homepage.cpp index 2749fe58..23971b70 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -74,9 +74,9 @@ QString HomePage::rekonqHomePage(const KUrl &url) QString menu = homePageMenu(url); QString speed; - if(url == KUrl("rekonq:lastSites")) + if(url == KUrl("rekonq:closedTabs")) { - speed = lastVisitedSites(); + speed = fillRecentlyClosedTabs(); } if(url == KUrl("rekonq:history")) { @@ -161,21 +161,21 @@ QString HomePage::homePageMenu(KUrl currentUrl) if(currentUrl == "rekonq:favorites" || currentUrl == "rekonq:home") menu += " current"; menu += "\"><a href=\"rekonq:favorites\">"; - menu += "<img src=\"file:///" + loader->iconPath("rating", KIconLoader::Desktop) + "\" />"; + menu += "<img src=\"file:///" + loader->iconPath("emblem-favorite", KIconLoader::Desktop) + "\" />"; menu += "Favorites</a></div>"; menu += "<div class=\"link"; - if(currentUrl == "rekonq:lastSites") + if(currentUrl == "rekonq:closedTabs") menu += " current"; - menu += "\"><a href=\"rekonq:lastSites\">"; - menu += "<img src=\"file:///" + loader->iconPath("edit-undo", KIconLoader::Desktop) + "\" />"; - menu += "Last Visited</a></div>"; + menu += "\"><a href=\"rekonq:closedTabs\">"; + menu += "<img src=\"file:///" + loader->iconPath("edit-redo", KIconLoader::Desktop) + "\" />"; + menu += "Closed Tabs</a></div>"; menu += "<div class=\"link"; if(currentUrl == "rekonq:bookmarks") menu += " current"; menu += "\"><a href=\"rekonq:bookmarks\">"; - menu += "<img src=\"file:///" + loader->iconPath("bookmarks-organize", KIconLoader::Desktop) + "\" />"; + menu += "<img src=\"file:///" + loader->iconPath("bookmarks", KIconLoader::Desktop) + "\" />"; menu += "Bookmarks</a></div>"; menu += "<div class=\"link"; @@ -206,7 +206,7 @@ QString HomePage::fillHistory() { QModelIndex son = model->index(j, 0, index ); history += son.data(HistoryModel::DateTimeRole).toDateTime().toString("hh:mm"); - history += " "; + history += ' '; history += QString("<a href=\"") + son.data(HistoryModel::UrlStringRole).toString() + QString("\">") + son.data().toString() + QString("</a>"); history += "<br />"; @@ -267,3 +267,28 @@ QString HomePage::createBookItem(const KBookmark &bookmark) books += "<a href=\"" + bookmark.url().prettyUrl() + "\">" + bookmark.text() + "</a><br />"; return books; } + + +QString HomePage::fillRecentlyClosedTabs() +{ + KUrl::List links = Application::instance()->mainWindow()->mainView()->recentlyClosedTabs(); + QString closed; + + Q_FOREACH( const KUrl &url, links) + { + QString text = url.prettyUrl(); + if(text.length() > 20) + { + text.truncate(17); + text += "..."; + } + closed += "<div class=\"thumbnail\">"; + closed += "<object type=\"application/image-preview\" data=\""; + closed += url.path() + "\" width=\"200\">"; + closed += "</object>"; + closed += "<br />"; + closed += "<a href=\"" + url.path() + "\">" + text + "</a></div>"; + } + + return closed; +} |