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());