|
Krita Source Code Documentation
|
#include <KisRecentFileIconCache.h>
Inheritance diagram for KisRecentFileIconCache:Classes | |
| struct | CacheItem |
Signals | |
| void | fileIconChanged (const QUrl &url, const QIcon &icon) |
Public Member Functions | |
| QIcon | getOrQueueFileIcon (const QUrl &url) |
| void | invalidateFileIcon (const QUrl &url) |
| KisRecentFileIconCache () | |
| void | reloadFileIcon (const QUrl &url) |
| ~KisRecentFileIconCache () | |
Static Public Member Functions | |
| static KisRecentFileIconCache * | instance () |
Private Slots | |
| void | cleanupOnQuit () |
| void | futureCanceled () |
| void | iconFetched () |
Private Attributes | |
| QMap< QUrl, CacheItem > | m_iconCacheMap |
| QThreadPool | m_iconFetchThreadPool |
Definition at line 16 of file KisRecentFileIconCache.h.
| KisRecentFileIconCache::KisRecentFileIconCache | ( | ) |
DO NOT USE! Use instance() instead. This constructor is public only because it is needed by Q_GLOBAL_STATIC.
Definition at line 67 of file KisRecentFileIconCache.cpp.
References cleanupOnQuit(), connect(), and m_iconFetchThreadPool.
| KisRecentFileIconCache::~KisRecentFileIconCache | ( | ) |
Definition at line 78 of file KisRecentFileIconCache.cpp.
|
privateslot |
Definition at line 139 of file KisRecentFileIconCache.cpp.
References m_iconFetchThreadPool.
|
signal |
|
privateslot |
Definition at line 175 of file KisRecentFileIconCache.cpp.
| QIcon KisRecentFileIconCache::getOrQueueFileIcon | ( | const QUrl & | url | ) |
Get a cached icon or queue fetching of the icon.
If the icon is cached and available, the cached icon is returned. Otherwise, a null default-constructed QIcon will be returned, and the fetching of the icon may be queued in a background thread.
Definition at line 91 of file KisRecentFileIconCache.cpp.
References connect(), futureCanceled(), KisRecentDocumentsModelWrapper::ICON_SIZE_LENGTH, iconFetched(), iconSize(), m_iconCacheMap, and m_iconFetchThreadPool.
|
privateslot |
Definition at line 147 of file KisRecentFileIconCache.cpp.
References fileIconChanged(), and m_iconCacheMap.
|
static |
Definition at line 82 of file KisRecentFileIconCache.cpp.
| void KisRecentFileIconCache::invalidateFileIcon | ( | const QUrl & | url | ) |
Invalidate (remove) a cached file icon. If the file icon is still in the process of being loaded, its result will be discarded.
Definition at line 119 of file KisRecentFileIconCache.cpp.
References m_iconCacheMap.
| void KisRecentFileIconCache::reloadFileIcon | ( | const QUrl & | url | ) |
Invalidate a cached file icon and trigger a reload of it.
Definition at line 133 of file KisRecentFileIconCache.cpp.
References getOrQueueFileIcon(), and invalidateFileIcon().
|
private |
Definition at line 22 of file KisRecentFileIconCache.h.
|
private |
Definition at line 23 of file KisRecentFileIconCache.h.