From 1f132f55739c42f67cf720d621e250a377c348db Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 12 Mar 2015 00:19:11 -0400 Subject: Make sure to load any specific icons for *.desktop files in lumina-fm. --- lumina-fm/MimeIconProvider.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lumina-fm/MimeIconProvider.h') diff --git a/lumina-fm/MimeIconProvider.h b/lumina-fm/MimeIconProvider.h index 344d6801..0c9ba98e 100644 --- a/lumina-fm/MimeIconProvider.h +++ b/lumina-fm/MimeIconProvider.h @@ -34,8 +34,16 @@ public: if(showthumbnails && (info.suffix().toLower()=="png" || info.suffix().toLower()=="jpg") ){ //make sure to only load small versions of the files into memory: could have hundreds of them... return QIcon( QPixmap(info.absoluteFilePath()).scaledToHeight(64) ); + }else if(info.fileName().endsWith(".desktop") ){ + bool ok = false; + XDGDesktop desk = LXDG::loadDesktopFile(info.absoluteFilePath(), ok); + if(ok){ + return LXDG::findIcon(desk.icon, "unknown"); + }else{ + return LXDG::findMimeIcon(info.fileName()); + } }else{ - return LXDG::findMimeIcon(info.suffix()); + return LXDG::findMimeIcon(info.fileName()); } }else{ return LXDG::findIcon("unknown",""); -- cgit