}
QThemeIconEntries QIconLoader::findIconHelper(const QString &themeName,
- const QString &iconName,
- QStringList &visited) const
+ const QString &iconName,
+ QStringList &visited) const
{
QThemeIconEntries entries;
Q_ASSERT(!themeName.isEmpty());
if (entries.isEmpty()) {
// Search recursively through inherited themes
foreach (const QString &parentTheme, theme.parents()) {
- if (!visited.contains(parentTheme)) // guard against recursion
+ if (!visited.contains(parentTheme)) { // guard against recursion
entries = findIconHelper(parentTheme, iconName, visited);
+ }
- if (!entries.isEmpty()) // success
+ if (!entries.isEmpty()) {
+ // success
break;
+ }
}
}
return entries;
// -------- Icon Loader Engine -------- //
-
-
-QIconLoaderEngine::QIconLoaderEngine(const QString& iconName)
- : m_iconName(iconName), m_key(0)
+QIconLoaderEngine::QIconLoaderEngine(const QString &iconName)
+ : m_iconName(iconName), m_key(0)
{
ensureLoaded();
}
struct QIconDirInfo
{
- enum Type { Fixed, Scalable, Threshold };
- QIconDirInfo(const QString &_path = QString()) :
- path(_path),
- size(0),
- maxSize(0),
- minSize(0),
- threshold(0),
- type(Threshold) {}
+ enum Type {
+ Fixed,
+ Scalable,
+ Threshold
+ };
+
+ QIconDirInfo(const QString &_path = QString())
+ : path(_path),
+ size(0),
+ maxSize(0),
+ minSize(0),
+ threshold(0),
+ type(Threshold) { }
QString path;
short size;
short maxSize;
};
class QIconLoaderEngineEntry
- {
+{
public:
QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state);
QThemeIconEntries m_entries;
QString m_iconName;
uint m_key;
-
- friend class QIconLoader;
};
class QIconTheme