From 020b9123a72e8ca7067e31703b835996508696c3 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 1 Sep 2024 12:23:31 +0200 Subject: [PATCH] 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 --- src/gui/image/qiconloader_p.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gui/image/qiconloader_p.h b/src/gui/image/qiconloader_p.h index 72b34eb3099..6900e03660f 100644 --- a/src/gui/image/qiconloader_p.h +++ b/src/gui/image/qiconloader_p.h @@ -20,10 +20,11 @@ #include #include -#include -#include #include #include +#include +#include +#include #include #include @@ -35,8 +36,8 @@ class QIconLoader; struct QIconDirInfo { - enum Type { Fixed, Scalable, Threshold, Fallback }; - enum Context { UnknownContext, Applications, MimeTypes }; + enum Type : uint8_t { Fixed, Scalable, Threshold, Fallback }; + enum Context : uint8_t { UnknownContext, Applications, MimeTypes }; QIconDirInfo(const QString &_path = QString()) : path(_path), size(0), @@ -204,7 +205,7 @@ private: mutable QString m_userFallbackTheme; mutable QString m_systemTheme; mutable QStringList m_iconDirs; - mutable QHash themeList; + mutable QVarLengthFlatMap themeList; mutable QStringList m_fallbackDirs; mutable QString m_iconName; };