Commit ac2bb879 authored by Eike Hein's avatar Eike Hein
Browse files

Move QIcon::fromTheme() out of delegate instanciation hotpath.

CCBUG:334332
parent a5ae6e8e
......@@ -23,6 +23,7 @@
#include "abstractmodel.h"
#include <QIcon>
#include <QPointer>
#include <QString>
......@@ -35,13 +36,13 @@ class AbstractEntry
virtual EntryType type() const = 0;
QString icon() const { return m_icon; }
QIcon icon() const { return m_icon; }
QString name() const { return m_name; }
static bool lessThan(AbstractEntry *e1, AbstractEntry *e2);
protected:
QString m_icon;
QIcon m_icon;
QString m_name;
};
......
......@@ -31,7 +31,7 @@ AppGroupEntry::AppGroupEntry(KServiceGroup::Ptr group, QAbstractListModel *paren
bool flat, int appNameFormat)
{
m_name = group->caption();
m_icon = group->icon();
m_icon = QIcon::fromTheme(group->icon());
m_model = new AppsModel(group->entryPath(), flat, parentModel);
static_cast<AppsModel *>(m_model.data())->setAppNameFormat(appNameFormat);
QObject::connect(parentModel, SIGNAL(refreshing()), m_model, SLOT(deleteLater()));
......@@ -58,7 +58,7 @@ AppEntry::AppEntry(KService::Ptr service, NameFormat nameFormat)
m_name = i18nc("Generic name (App name)", "%1 (%2)", genericName, name);
}
m_icon = service->icon();
m_icon = QIcon::fromTheme(service->icon());
m_service = service;
}
......
......@@ -34,7 +34,7 @@ DocEntry::DocEntry(const QString &name, const QString &icon,
const QString &url, const QString &desktopPath)
{
m_name = name;
m_icon = icon;
m_icon = QIcon::fromTheme(icon);
m_url = url;
m_desktopPath = desktopPath;
}
......
......@@ -29,7 +29,7 @@ GroupEntry::GroupEntry(const QString &name, const QString &icon,
AbstractModel *model, AbstractModel *parentModel)
{
m_name = name;
m_icon = icon;
m_icon = QIcon::fromTheme(icon);
m_model = model;
QObject::connect(parentModel, SIGNAL(refreshing()), m_model, SLOT(deleteLater()));
}
......
......@@ -33,7 +33,7 @@ SystemEntry::SystemEntry(SystemEntry::Action action, const QString &name, const
{
m_action = action;
m_name = name;
m_icon = icon;
m_icon = QIcon::fromTheme(icon);
}
SystemModel::SystemModel(QObject *parent) : AbstractModel(parent)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment