From f97213ff6011789f6d7afd4ec6dfab1dbbf17f00 Mon Sep 17 00:00:00 2001 From: JunjieBai Date: Fri, 11 Aug 2023 17:04:47 +0800 Subject: [PATCH] perf(app-database-service):use the lowercase letters to match the windowClassClass. --- ukui-search-app-data-service/app-db-manager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ukui-search-app-data-service/app-db-manager.cpp b/ukui-search-app-data-service/app-db-manager.cpp index 18b9dd3..1d6f023 100644 --- a/ukui-search-app-data-service/app-db-manager.cpp +++ b/ukui-search-app-data-service/app-db-manager.cpp @@ -1540,9 +1540,9 @@ QString AppDBManager::tranWinIdToDesktopFilePath(const QDBusVariant &id) QString classClass = info.windowClassClass(); //the 2nd part of WM_CLASS, specified by the application writer QSqlQuery query(m_database); query.setForwardOnly(true); - query.prepare("SELECT DESKTOP_FILE_PATH, START_UP_WMCLASS FROM APPINFO WHERE EXEC LIKE :classClass OR DESKTOP_FILE_PATH LIKE :classClass OR START_UP_WMCLASS=:windowClassClass"); + query.prepare("SELECT DESKTOP_FILE_PATH, START_UP_WMCLASS FROM APPINFO WHERE EXEC LIKE :classClass OR DESKTOP_FILE_PATH LIKE :classClass OR LOWER(START_UP_WMCLASS)=:windowClassClass"); query.bindValue(":classClass", "%" + classClass + "%"); - query.bindValue(":windowClassClass", classClass); + query.bindValue(":windowClassClass", classClass.toLower()); if (query.exec()) { QMap wmClassInfos; @@ -1557,7 +1557,7 @@ QString AppDBManager::tranWinIdToDesktopFilePath(const QDBusVariant &id) if (it.key().startsWith(AUTOSTART_APP_DESKTOP_PATH)) { continue; } - if (it.key().section("/", -1) == (classClass + ".desktop") || it.value() == classClass) { + if (it.key().section("/", -1) == (classClass + ".desktop") || it.value().toLower() == classClass.toLower()) { desktopFilePath = it.key(); break; }