Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Desktop
Commits
ac2bb879
Commit
ac2bb879
authored
May 05, 2014
by
Eike Hein
Browse files
Move QIcon::fromTheme() out of delegate instanciation hotpath.
CCBUG:334332
parent
a5ae6e8e
Changes
5
Hide whitespace changes
Inline
Side-by-side
applets/kicker/plugin/abstractentry.h
View file @
ac2bb879
...
...
@@ -23,6 +23,7 @@
#include "abstractmodel.h"
#include <QIcon>
#include <QPointer>
#include <QString>
...
...
@@ -35,13 +36,13 @@ class AbstractEntry
virtual
EntryType
type
()
const
=
0
;
Q
String
icon
()
const
{
return
m_icon
;
}
Q
Icon
icon
()
const
{
return
m_icon
;
}
QString
name
()
const
{
return
m_name
;
}
static
bool
lessThan
(
AbstractEntry
*
e1
,
AbstractEntry
*
e2
);
protected:
Q
String
m_icon
;
Q
Icon
m_icon
;
QString
m_name
;
};
...
...
applets/kicker/plugin/appsmodel.cpp
View file @
ac2bb879
...
...
@@ -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
;
}
...
...
applets/kicker/plugin/recentdocsmodel.cpp
View file @
ac2bb879
...
...
@@ -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
;
}
...
...
applets/kicker/plugin/rootmodel.cpp
View file @
ac2bb879
...
...
@@ -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
()));
}
...
...
applets/kicker/plugin/systemmodel.cpp
View file @
ac2bb879
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment