From cf9e768b4b0e5731037f854c084ea7dbcbac2c50 Mon Sep 17 00:00:00 2001 From: iaom Date: Fri, 23 Feb 2024 15:17:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(libsearch):=E8=A7=A3=E5=86=B3=E5=8A=A0?= =?UTF-8?q?=E8=BD=BDsvg=EF=BC=88=E7=BB=9D=E5=AF=B9=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E7=9A=84=E5=9B=BE=E7=89=87=EF=BC=89=E5=9B=BE=E6=A0=87=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libsearch/icon-loader.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libsearch/icon-loader.cpp b/libsearch/icon-loader.cpp index e78aadc..0111559 100644 --- a/libsearch/icon-loader.cpp +++ b/libsearch/icon-loader.cpp @@ -22,12 +22,21 @@ #include #include #include +#include namespace UkuiSearch { static QMutex qtIconMutex; static QMutex xdgIconMutex; QIcon IconLoader::loadIconQt(const QString &name, const QIcon &fallback) { QMutexLocker locker(&qtIconMutex); + if(QFile::exists(name)) { + QIcon icon(name); + if(!QIcon(name).isNull()) { + return icon; + } else { + return fallback; + } + } return QIcon::fromTheme(name,fallback); }