Krita Source Code Documentation
Loading...
Searching...
No Matches
KisRecentFileIconCache.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2022 Alvin Wong <alvin@alvinhc.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KIS_RECENT_FILE_ICON_CACHE_H
8#define KIS_RECENT_FILE_ICON_CACHE_H
9
10#include <QFuture>
11#include <QIcon>
12#include <QMap>
13#include <QThreadPool>
14#include <QUrl>
15
16class KisRecentFileIconCache : public QObject
17{
18 Q_OBJECT
19
20 struct CacheItem;
21
22 QMap<QUrl, CacheItem> m_iconCacheMap;
24
25public:
32
33public:
35
43 QIcon getOrQueueFileIcon(const QUrl &url);
44
49 void invalidateFileIcon(const QUrl &url);
50
54 void reloadFileIcon(const QUrl &url);
55
56private Q_SLOTS:
57 void cleanupOnQuit();
58 void iconFetched();
59 void futureCanceled();
60
61Q_SIGNALS:
62 void fileIconChanged(const QUrl &url, const QIcon &icon);
63};
64
65#endif /* KIS_RECENT_FILE_ICON_CACHE_H */
void fileIconChanged(const QUrl &url, const QIcon &icon)
QIcon getOrQueueFileIcon(const QUrl &url)
static KisRecentFileIconCache * instance()
QMap< QUrl, CacheItem > m_iconCacheMap
void invalidateFileIcon(const QUrl &url)
void reloadFileIcon(const QUrl &url)