From 6662b1ab518751d4f1f9f3b0295189f8e7c1d371 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 12 Apr 2017 09:04:47 -0400 Subject: Add an additional icon search fallback for mimetype icons (use the *-x-generic icon) --- src-qt5/core/libLumina/LuminaXDG.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src-qt5/core') diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index f34bc0e8..d17cc330 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -843,8 +843,12 @@ QIcon LXDG::findIcon(QString iconName, QString fallback){ } } //Use the fallback icon if necessary - if(ico.isNull() && !fallback.isEmpty()){ - ico = LXDG::findIcon(fallback,""); + if(ico.isNull() ){ + if(!fallback.isEmpty()){ ico = LXDG::findIcon(fallback,""); } + else if(iconName.contains("-x-") && !iconName.endsWith("-x-generic")){ + //mimetype - try to use the generic type icon + ico = LXDG::findIcon(iconName.section("-x-",0,0)+"-x-generic", ""); + } } if(ico.isNull()){ qDebug() << "Could not find icon:" << iconName << fallback; -- cgit