perf(app-database-service):use the lowercase letters to match the windowClassClass.

This commit is contained in:
JunjieBai 2023-08-11 17:04:47 +08:00 committed by iaom
parent b9bec65505
commit 4f38078c0a
1 changed files with 3 additions and 3 deletions

View File

@ -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<QString, QString> 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;
}