From e53d13c54bb4878f82cfe8477c225a603911d079 Mon Sep 17 00:00:00 2001 From: iaom Date: Mon, 27 Feb 2023 13:45:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=94=E7=94=A8=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=8F=92=E4=BB=B6=E6=8E=A5=E5=8F=A3=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libsearch/appsearch/app-search-plugin.cpp | 9 ++------- .../searchinterface/searchtasks/app-search-task.cpp | 3 +-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/libsearch/appsearch/app-search-plugin.cpp b/libsearch/appsearch/app-search-plugin.cpp index 70ff3ff..4cb46a7 100644 --- a/libsearch/appsearch/app-search-plugin.cpp +++ b/libsearch/appsearch/app-search-plugin.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "file-utils.h" using namespace UkuiSearch; @@ -172,13 +173,7 @@ void AppSearchPlugin::run() SearchPluginIface::ResultInfo ri; ri.actionKey = oneResult.getExtral().at(0).toString(); ri.name = oneResult.getExtral().at(1).toString(); - QIcon icon = oneResult.getExtral().at(2).value(); - - if(icon.isNull()) { - ri.icon = QIcon(":/res/icons/unknown.svg"); - } else { - ri.icon = icon; - } + ri.icon = XdgIcon::fromTheme(oneResult.getExtral().at(2).toString(), QIcon(":/res/icons/unknown.svg")); SearchPluginIface::DescriptionInfo description; description.key = QString(tr("Application Description:")); description.value = oneResult.getExtral().at(3).toString(); diff --git a/libsearch/searchinterface/searchtasks/app-search-task.cpp b/libsearch/searchinterface/searchtasks/app-search-task.cpp index feb76cc..ccba138 100644 --- a/libsearch/searchinterface/searchtasks/app-search-task.cpp +++ b/libsearch/searchinterface/searchtasks/app-search-task.cpp @@ -1,7 +1,6 @@ #include "app-search-task.h" #include "index-status-recorder.h" #include "common.h" -#include #include #include #include @@ -81,7 +80,7 @@ void AppSearchWorker::run() info << QVariant(results.at(i*3 + 1)); } if (dataType & UkuiSearch::ApplicationIconName) { - info << QVariant(XdgIcon::fromTheme(results.at(i*3 + 2))); + info << QVariant(results.at(i*3 + 2)); } if (dataType & UkuiSearch::ApplicationDescription) {//本地应用暂无简介 info << QVariant(QString());