QIconLoader: replace an inefficient QList with a QVector
QIconDirInfo is larger than a pointer, so holding it in a QList is horribly inefficient. Fix by holding it in a QVector instead. Change-Id: I6551d2d2941447e600a33c3d68edf46db002d96c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>bb10
parent
0611f8d995
commit
87ccab8bd6
|
|
@ -268,7 +268,7 @@ QThemeIconEntries QIconLoader::findIconHelper(const QString &themeName,
|
|||
}
|
||||
|
||||
QString contentDir = theme.contentDir() + QLatin1Char('/');
|
||||
QList<QIconDirInfo> subDirs = theme.keyList();
|
||||
const QVector<QIconDirInfo> subDirs = theme.keyList();
|
||||
|
||||
const QString svgext(QLatin1String(".svg"));
|
||||
const QString pngext(QLatin1String(".png"));
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@
|
|||
#include <private/qicon_p.h>
|
||||
#include <private/qfactoryloader_p.h>
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QTypeInfo>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
|
@ -146,13 +147,13 @@ public:
|
|||
QIconTheme(const QString &name);
|
||||
QIconTheme() : m_valid(false) {}
|
||||
QStringList parents() { return m_parents; }
|
||||
QList <QIconDirInfo> keyList() { return m_keyList; }
|
||||
QVector<QIconDirInfo> keyList() { return m_keyList; }
|
||||
QString contentDir() { return m_contentDir; }
|
||||
bool isValid() { return m_valid; }
|
||||
|
||||
private:
|
||||
QString m_contentDir;
|
||||
QList <QIconDirInfo> m_keyList;
|
||||
QVector<QIconDirInfo> m_keyList;
|
||||
QStringList m_parents;
|
||||
bool m_valid;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue