diff options
Diffstat (limited to 'src/icons')
-rw-r--r-- | src/icons/iconmanager.cpp | 14 | ||||
-rw-r--r-- | src/icons/iconmanager.h | 5 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/icons/iconmanager.cpp b/src/icons/iconmanager.cpp index 7bc47eec..0a1645d7 100644 --- a/src/icons/iconmanager.cpp +++ b/src/icons/iconmanager.cpp @@ -209,12 +209,20 @@ QString IconManager::iconPathForUrl(const KUrl &url) KIcon IconManager::engineFavicon(const KUrl &url) { - if (QFile::exists(_faviconsDir + url.host() + QL1S(".png"))) - return KIcon(QIcon(_faviconsDir + url.host() + QL1S(".png"))); + QString h = url.host(); + if (QFile::exists(_faviconsDir + h + QL1S(".png"))) + { + _engineFaviconHosts.removeAll(h); + return KIcon(QIcon(_faviconsDir + h + QL1S(".png"))); + } // if engine favicon is NOT found, download it // will autodelete itself when done - new WebIcon(url); + if (!_engineFaviconHosts.contains(h)) + { + _engineFaviconHosts << h; + new WebIcon(url); + } kDebug() << "NO ENGINE FAVICON"; return KIcon("text-html"); diff --git a/src/icons/iconmanager.h b/src/icons/iconmanager.h index 659eff88..74cf706a 100644 --- a/src/icons/iconmanager.h +++ b/src/icons/iconmanager.h @@ -34,6 +34,7 @@ #include <QObject> #include <QWeakPointer> #include <QString> +#include <QStringList> // Forward Declarations class KIcon; @@ -68,7 +69,9 @@ private: QString _faviconsDir; QString _tempIconsDir; - + + QStringList _engineFaviconHosts; + static QWeakPointer<IconManager> s_iconManager; }; |