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;
25
26public:
33
34public:
36
44 QIcon getOrQueueFileIcon(const QUrl &url);
45
50 void invalidateFileIcon(const QUrl &url);
51
55 void reloadFileIcon(const QUrl &url);
56
57private Q_SLOTS:
58 void cleanupOnQuit();
59 void iconFetched();
60 void futureCanceled();
61
62Q_SIGNALS:
63 void fileIconChanged(const QUrl &url, const QIcon &icon);
64};
65
66#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)