summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Uzumcu <furkanuzumcu@gmail.com>2011-11-24 18:39:59 +0100
committerAndrea Diamantini <adjam7@gmail.com>2011-11-24 18:39:59 +0100
commit8fa117303cf3290bb6c406b7d86e6aa34fb55c8e (patch)
tree4aa1dc05d5bd9c24dabd7404666a707a29e93df9
parentProperly handle window/app close (diff)
downloadrekonq-8fa117303cf3290bb6c406b7d86e6aa34fb55c8e.tar.xz
Add a "clear downloads" action in the downloads page and a
"clear history" action... guess where?!?! Google code-in 2011 task by Huseyin Zengin, GCI Student. MANY THANKS FOR!!! REVIEW: 103217 REVIEWED-BY: adjam
-rw-r--r--src/newtabpage.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp
index f797e497..271ad4bb 100644
--- a/src/newtabpage.cpp
+++ b/src/newtabpage.cpp
@@ -110,10 +110,16 @@ void NewTabPage::generate(const KUrl &url)
return;
}
}
- if (url.fileName() == QL1S("clear"))
+ if (url == KUrl("about:downloads/clear"))
{
- rApp->mainWindow()->actionByName("clear_private_data")->trigger();
- generate(QString(QL1S("about:") + url.directory()));
+ rApp->downloadManager()->clearDownloadsHistory();
+ generate(KUrl("about:downloads"));
+ return;
+ }
+ if (url == KUrl("about:history/clear"))
+ {
+ rApp->historyManager()->clear();
+ generate(KUrl("about:history"));
return;
}
if (url == KUrl("about:bookmarks/edit"))
@@ -394,11 +400,11 @@ void NewTabPage::historyPage()
{
m_root.addClass(QL1S("history"));
- const QWebElement clearData = createLinkItem(i18n("Clear Private Data"),
- QL1S("about:history/clear"),
- QL1S("edit-clear"),
- KIconLoader::Toolbar);
- m_root.document().findFirst(QL1S("#actions")).appendInside(clearData);
+ const QWebElement clearHistory = createLinkItem(i18n("Clear History"),
+ QL1S("about:history/clear"),
+ QL1S("edit-clear"),
+ KIconLoader::Toolbar);
+ m_root.document().findFirst(QL1S("#actions")).appendInside(clearHistory);
HistoryTreeModel *model = rApp->historyManager()->historyTreeModel();
@@ -563,11 +569,11 @@ void NewTabPage::downloadsPage()
{
m_root.addClass(QL1S("downloads"));
- const QWebElement clearData = createLinkItem(i18n("Clear Private Data"),
- QL1S("about:downloads/clear"),
- QL1S("edit-clear"),
- KIconLoader::Toolbar);
- m_root.document().findFirst(QL1S("#actions")).appendInside(clearData);
+ const QWebElement clearDownloads = createLinkItem(i18n("Clear Downloads"),
+ QL1S("about:downloads/clear"),
+ QL1S("edit-clear"),
+ KIconLoader::Toolbar);
+ m_root.document().findFirst(QL1S("#actions")).appendInside(clearDownloads);
DownloadList list = rApp->downloadManager()->downloads();