mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Merge branch 'Falkon/3.1'
This commit is contained in:
commit
721d203366
|
@ -187,6 +187,8 @@ QImage IconProvider::imageForUrl(const QUrl &url, bool allowNull)
|
|||
return allowNull ? QImage() : IconProvider::emptyWebImage();
|
||||
}
|
||||
|
||||
QMutexLocker locker(&instance()->m_iconCacheMutex);
|
||||
|
||||
const QByteArray encodedUrl = encodeUrl(url);
|
||||
|
||||
if (QImage *img = instance()->m_urlImageCache.object(encodedUrl)) {
|
||||
|
@ -224,6 +226,8 @@ QImage IconProvider::imageForDomain(const QUrl &url, bool allowNull)
|
|||
return allowNull ? QImage() : IconProvider::emptyWebImage();
|
||||
}
|
||||
|
||||
QMutexLocker locker(&instance()->m_iconCacheMutex);
|
||||
|
||||
foreach (const BufferedIcon &ic, instance()->m_iconBuffer) {
|
||||
if (ic.first.host() == url.host()) {
|
||||
return ic.second;
|
||||
|
@ -249,6 +253,8 @@ IconProvider* IconProvider::instance()
|
|||
|
||||
void IconProvider::saveIconsToDatabase()
|
||||
{
|
||||
QMutexLocker locker(&instance()->m_iconCacheMutex);
|
||||
|
||||
foreach (const BufferedIcon &ic, m_iconBuffer) {
|
||||
QByteArray ba;
|
||||
QBuffer buffer(&ba);
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <QImage>
|
||||
#include <QUrl>
|
||||
#include <QCache>
|
||||
#include <QMutex>
|
||||
|
||||
#include <functional>
|
||||
|
||||
|
@ -82,6 +83,7 @@ private:
|
|||
QIcon m_bookmarkIcon;
|
||||
QVector<BufferedIcon> m_iconBuffer;
|
||||
QCache<QByteArray, QImage> m_urlImageCache;
|
||||
QMutex m_iconCacheMutex;
|
||||
|
||||
AutoSaver* m_autoSaver;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user