Commit 1336664a authored by Marco Martin's avatar Marco Martin
Browse files

restore icon loading from kservice

CCBUG:296894
parent 96f5ad22
......@@ -552,7 +552,16 @@ void MetadataModel::newEntries(const QList< Nepomuk::Query::Result > &entries)
if (!symbol.toString().isEmpty()) {
m_cachedResources[resource][Icon] = symbol.toString();
} else {
m_cachedResources[resource][Icon] = KMimeType::iconNameForUrl(m_cachedResources[resource][Url].toString());
//if it's an application, fetch the icon from the desktop file
Nepomuk::Types::Class resClass(resource.resourceType());
if (resClass.label() == "Application") {
KService::Ptr serv = KService::serviceByDesktopPath(m_cachedResources[resource][Url].toUrl().path());
if (serv) {
m_cachedResources[resource][Icon] = serv->icon();
}
} else {
m_cachedResources[resource][Icon] = KMimeType::iconNameForUrl(m_cachedResources[resource][Url].toString());
}
}
//those seems to not be possible avoiding to access the resource
......
Markdown is supported
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