fix(app-database):classClass为空时会找错desktop文件的问题.

This commit is contained in:
JunjieBai 2024-04-07 16:46:48 +08:00 committed by iaom
parent e107ea3e07
commit 63ec090747
1 changed files with 1 additions and 1 deletions

View File

@ -1313,7 +1313,7 @@ QString AppDBManager::tranWinIdToDesktopFilePath(const QDBusVariant &id)
} }
} }
//没有查到 //没有查到
if (desktopFilePath.isEmpty()) { if (desktopFilePath.isEmpty() && !classClass.isEmpty()) {
query.prepare("SELECT DESKTOP_FILE_PATH, START_UP_WMCLASS FROM APPINFO WHERE EXEC LIKE :classClass OR DESKTOP_FILE_PATH LIKE :classClass"); query.prepare("SELECT DESKTOP_FILE_PATH, START_UP_WMCLASS FROM APPINFO WHERE EXEC LIKE :classClass OR DESKTOP_FILE_PATH LIKE :classClass");
query.bindValue(":classClass", "%" + classClass + "%"); query.bindValue(":classClass", "%" + classClass + "%");