1
/* This file is part of the sni-qt project
2
Copyright 2011 Canonical
3
Author: Aurelien Gateau <aurelien.gateau@canonical.com>
5
sni-qt is free software; you can redistribute it and/or modify it under the
6
terms of the GNU Lesser General Public License (LGPL) as published by the
7
Free Software Foundation; version 3 of the License.
9
sni-qt is distributed in the hope that it will be useful, but WITHOUT ANY
10
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
14
You should have received a copy of the GNU Lesser General Public License
15
along with sni-qt. If not, see <http://www.gnu.org/licenses/>.
22
#include <QStringList>
27
* This class will save pixmaps from icons in a temporary dir on the disk,
28
* making it possible to pass filenames for icons without names.
30
class IconCache : public QObject
34
IconCache(const QString& baseDir, QObject* parent=0);
36
static const int MaxIconCount;
38
QString themePath() const;
40
QString nameForIcon(const QIcon& icon) const;
42
// Internal, testing only
43
QStringList cacheKeys() const { return m_cacheKeys; }
47
mutable QStringList m_cacheKeys;
49
void cacheIcon(const QIcon&) const;
50
void trimCache() const;
53
#endif /* ICONCACHE_H */