summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-11-21 02:14:18 +0100
committerAndrea Diamantini <adjam7@gmail.com>2013-11-21 02:14:18 +0100
commite367678afc6bc1f5bc2a0c5ca3081418a4502de7 (patch)
treee314e59aa759092b21361474e5e73b0c64f14664
parentimprovement on urlbar suggestions (diff)
downloadrekonq-e367678afc6bc1f5bc2a0c5ca3081418a4502de7.tar.xz
Do NOT download everytime engines favicons if present
-rw-r--r--src/icons/webicon.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/icons/webicon.cpp b/src/icons/webicon.cpp
index b27b2e36..7230b3a6 100644
--- a/src/icons/webicon.cpp
+++ b/src/icons/webicon.cpp
@@ -38,6 +38,7 @@
#include <KStandardDirs>
// Qt Includes
+#include <QFile>
#include <QTimer>
#include <QWebFrame>
#include <QWebElement>
@@ -72,6 +73,19 @@ void WebIcon::saveIcon(bool b)
return;
}
+ QString faviconsDir = KStandardDirs::locateLocal("cache" , "favicons/" , true);
+ QString faviconPath = faviconsDir + m_url.host();
+
+ if ( QFile::exists(faviconPath + QL1S(".png")) )
+ {
+ this->deleteLater();
+ return;
+ }
+
+ // dest url
+ KUrl destUrl(faviconPath);
+ kDebug() << "DEST URL: " << destUrl;
+
// the simplest way..
const QString rootUrlString = m_url.scheme() + QL1S("://") + m_url.host();
@@ -111,12 +125,6 @@ void WebIcon::saveIcon(bool b)
}
kDebug() << "FAVICON RETRIEVING URL: " << faviconUrl;
-
- QString faviconsDir = KStandardDirs::locateLocal("cache" , "favicons/" , true);
-
- // dest url
- KUrl destUrl(faviconsDir + m_url.host());
- kDebug() << "DEST URL: " << destUrl;
// will autodelete itself when done
new IconDownloader(faviconUrl, destUrl);