QIconLoader: misc improvements
- use QVarLengthFlatMap instead QHash for QIconLoader:.themeList as it's unlikely that there are more than 5 themes loaded at once - use uint8_t for two internal enums in QIconDirInfo to reduce it's size from 48 to 40 bytes Change-Id: Ie5d1c78064b5410f3da9314e74d1a4ea5d3b32fd Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
parent
81bcff5c78
commit
020b9123a7
@ -20,10 +20,11 @@
|
|||||||
|
|
||||||
#include <QtGui/QIcon>
|
#include <QtGui/QIcon>
|
||||||
#include <QtGui/QIconEngine>
|
#include <QtGui/QIconEngine>
|
||||||
#include <private/qiconengine_p.h>
|
|
||||||
#include <QtCore/QHash>
|
|
||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
#include <QtCore/QSharedPointer>
|
#include <QtCore/QSharedPointer>
|
||||||
|
#include <QtCore/QVarLengthArray>
|
||||||
|
#include <private/qflatmap_p.h>
|
||||||
|
#include <private/qiconengine_p.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -35,8 +36,8 @@ class QIconLoader;
|
|||||||
|
|
||||||
struct QIconDirInfo
|
struct QIconDirInfo
|
||||||
{
|
{
|
||||||
enum Type { Fixed, Scalable, Threshold, Fallback };
|
enum Type : uint8_t { Fixed, Scalable, Threshold, Fallback };
|
||||||
enum Context { UnknownContext, Applications, MimeTypes };
|
enum Context : uint8_t { UnknownContext, Applications, MimeTypes };
|
||||||
QIconDirInfo(const QString &_path = QString()) :
|
QIconDirInfo(const QString &_path = QString()) :
|
||||||
path(_path),
|
path(_path),
|
||||||
size(0),
|
size(0),
|
||||||
@ -204,7 +205,7 @@ private:
|
|||||||
mutable QString m_userFallbackTheme;
|
mutable QString m_userFallbackTheme;
|
||||||
mutable QString m_systemTheme;
|
mutable QString m_systemTheme;
|
||||||
mutable QStringList m_iconDirs;
|
mutable QStringList m_iconDirs;
|
||||||
mutable QHash <QString, QIconTheme> themeList;
|
mutable QVarLengthFlatMap <QString, QIconTheme, 5> themeList;
|
||||||
mutable QStringList m_fallbackDirs;
|
mutable QStringList m_fallbackDirs;
|
||||||
mutable QString m_iconName;
|
mutable QString m_iconName;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user