2 * This file Copyright (C) 2012-2014 Mnemosyne LLC
4 * It may be used under the GNU GPL versions 2 or 3
5 * or any future license endorsed by Mnemosyne LLC.
7 * $Id: favicon.h 14241 2014-01-21 03:10:30Z jordan $
10 #ifndef FAVICON_CACHE_H
11 #define FAVICON_CACHE_H
13 class QNetworkAccessManager
;
22 class Favicons
: public QObject
28 static QString
getHost( const QUrl
& url
);
35 // returns a cached pixmap, or a NULL pixmap if there's no match in the cache
36 QPixmap
find (const QUrl
& url
);
38 // returns a cached pixmap, or a NULL pixmap if there's no match in the cache
39 QPixmap
findFromHost (const QString
& host
);
41 // this will emit a signal when (if) the icon becomes ready
42 void add (const QUrl
& url
);
46 void pixmapReady (const QString
& host
);
50 QNetworkAccessManager
* myNAM
;
51 QMap
<QString
,QPixmap
> myPixmaps
;
53 QString
getCacheDir ();
54 void ensureCacheDirHasBeenScanned ();
58 void onRequestFinished (QNetworkReply
* reply
);