summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-10-19 11:56:15 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-10-19 11:56:15 +0200
commit12810f40be01fad3384c0ae1527d0a0f5a378886 (patch)
treeb03775518b8f4dd417041f59df1e8ab28071c704 /src
parentFixing rebase... (diff)
downloadrekonq-12810f40be01fad3384c0ae1527d0a0f5a378886.tar.xz
Porting recently closed tabs to use HistoryItem.
This way we can have more useful infos about
Diffstat (limited to 'src')
-rw-r--r--src/homepage.cpp8
-rw-r--r--src/mainview.cpp9
-rw-r--r--src/mainview.h5
3 files changed, 13 insertions, 9 deletions
diff --git a/src/homepage.cpp b/src/homepage.cpp
index d7294aba..9a15f249 100644
--- a/src/homepage.cpp
+++ b/src/homepage.cpp
@@ -279,12 +279,12 @@ QString HomePage::createBookItem(const KBookmark &bookmark)
QString HomePage::fillClosedTabs()
{
- KUrl::List links = Application::instance()->mainWindow()->mainView()->recentlyClosedTabs();
+ QList<HistoryItem> links = Application::instance()->mainWindow()->mainView()->recentlyClosedTabs();
QString closed;
- Q_FOREACH( const KUrl &url, links)
+ Q_FOREACH( const HistoryItem &item, links)
{
- QString text = url.prettyUrl();
+ QString text = item.title;
if(text.length() > 20)
{
text.truncate(17);
@@ -293,7 +293,7 @@ QString HomePage::fillClosedTabs()
closed += "<div class=\"thumbnail\">";
closed += "<object type=\"application/image-preview\" data=\"";
- closed += url.prettyUrl() + "\" width=\"200\">";
+ closed += item.url + "\" width=\"200\">";
closed += "<param name=\"title\" value=\"" + text + "\" />";
closed += "</object>";
closed += "</div>";
diff --git a/src/mainview.cpp b/src/mainview.cpp
index dbd59e91..1848e682 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -420,8 +420,11 @@ void MainView::slotCloseTab(int index)
//store close tab except homepage
if (!tab->url().prettyUrl().startsWith("rekonq:") && !tab->url().isEmpty())
{
- m_recentlyClosedTabs.removeAll(tab->url());
- m_recentlyClosedTabs.prepend(tab->url());
+ QString title = tab->title();
+ QString url = tab->url().prettyUrl();
+ HistoryItem item(url, QDateTime::currentDateTime(), title);
+ m_recentlyClosedTabs.removeAll(item);
+ m_recentlyClosedTabs.prepend(item);
}
}
@@ -582,7 +585,7 @@ QLabel *MainView::animatedLoading(int index, bool addMovie)
}
-KUrl::List MainView::recentlyClosedTabs()
+QList<HistoryItem> MainView::recentlyClosedTabs()
{
return m_recentlyClosedTabs;
}
diff --git a/src/mainview.h b/src/mainview.h
index 8c993a63..c2795048 100644
--- a/src/mainview.h
+++ b/src/mainview.h
@@ -34,6 +34,7 @@
#include "webview.h"
#include "webpage.h"
#include "application.h"
+#include "history.h"
// KDE Includes
#include <KTabWidget>
@@ -89,7 +90,7 @@ public:
*/
WebView *newWebView(bool focused = true, bool nearParent = false);
- KUrl::List recentlyClosedTabs();
+ QList<HistoryItem> recentlyClosedTabs();
signals:
// tab widget signals
@@ -159,7 +160,7 @@ private:
int m_currentTabIndex;
- KUrl::List m_recentlyClosedTabs;
+ QList<HistoryItem> m_recentlyClosedTabs;
};
#endif // MAINVIEW_H