summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-09-10 03:53:37 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-09-10 03:53:37 +0200
commit94296c27926dd3d6d9267e088153d527e8ff122b (patch)
tree735fc6f6da599ff262d5263a0c5702b0d2ea9dad /src
parentIconManager cleanup (diff)
downloadrekonq-94296c27926dd3d6d9267e088153d527e8ff122b.tar.xz
Reimplemented the clearIconCache method
Diffstat (limited to 'src')
-rw-r--r--src/iconmanager.cpp14
-rw-r--r--src/iconmanager.h2
-rw-r--r--src/mainwindow.cpp2
3 files changed, 17 insertions, 1 deletions
diff --git a/src/iconmanager.cpp b/src/iconmanager.cpp
index 3829776d..f8d1a6a4 100644
--- a/src/iconmanager.cpp
+++ b/src/iconmanager.cpp
@@ -41,6 +41,8 @@
#include <KUrl>
// Qt Includes
+#include <QtCore/QDir>
+
#include <QtWebKit/QWebElement>
#include <QtWebKit/QWebFrame>
#include <QtWebKit/QWebSettings>
@@ -173,3 +175,15 @@ void IconManager::downloadIconFromUrl(const KUrl &url)
{
new WebIcon(url, this);
}
+
+
+void IconManager::clearIconCache()
+{
+ QString faviconDir = KStandardDirs::locateLocal("cache" , "favicons/" , true);
+ QDir d(faviconDir);
+ QStringList favicons = d.entryList();
+ Q_FOREACH(const QString &fav, favicons)
+ {
+ d.remove(fav);
+ }
+}
diff --git a/src/iconmanager.h b/src/iconmanager.h
index 826706b7..9e451431 100644
--- a/src/iconmanager.h
+++ b/src/iconmanager.h
@@ -52,6 +52,8 @@ public:
void provideIcon(QWebPage *page, const KUrl &url, bool notify = true);
void downloadIconFromUrl(const KUrl &url);
+
+ void clearIconCache();
Q_SIGNALS:
void iconChanged();
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index f1cec171..4c766ba0 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1182,7 +1182,7 @@ void MainWindow::clearPrivateData()
if (clearWidget.clearWebIcons->isChecked())
{
- QWebSettings::clearIconDatabase();
+ Application::iconManager()->clearIconCache();
}
if (clearWidget.homePageThumbs->isChecked())