perf(app-database-service):use the lowercase letters to match the windowClassClass.
This commit is contained in:
parent
87e6da7336
commit
f97213ff60
|
@ -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
|
QString classClass = info.windowClassClass(); //the 2nd part of WM_CLASS, specified by the application writer
|
||||||
QSqlQuery query(m_database);
|
QSqlQuery query(m_database);
|
||||||
query.setForwardOnly(true);
|
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(":classClass", "%" + classClass + "%");
|
||||||
query.bindValue(":windowClassClass", classClass);
|
query.bindValue(":windowClassClass", classClass.toLower());
|
||||||
|
|
||||||
if (query.exec()) {
|
if (query.exec()) {
|
||||||
QMap<QString, QString> wmClassInfos;
|
QMap<QString, QString> wmClassInfos;
|
||||||
|
@ -1557,7 +1557,7 @@ QString AppDBManager::tranWinIdToDesktopFilePath(const QDBusVariant &id)
|
||||||
if (it.key().startsWith(AUTOSTART_APP_DESKTOP_PATH)) {
|
if (it.key().startsWith(AUTOSTART_APP_DESKTOP_PATH)) {
|
||||||
continue;
|
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();
|
desktopFilePath = it.key();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue