fix(app-database-service):do not start a transaction while setting app to favourites.

This commit is contained in:
JunjieBai 2024-03-11 13:49:28 +08:00 committed by iaom
parent 9d48e482eb
commit 427384f7b8
1 changed files with 3 additions and 0 deletions

View File

@ -791,6 +791,9 @@ bool AppDBManager::handleFavoritesStateUpdate(const QString &desktopFilePath, co
ApplicationInfoMap infos; ApplicationInfoMap infos;
//更新favorites状态 //更新favorites状态
if (!this->startTransaction()) {
return false;
}
cmd = QString("UPDATE APPINFO SET MODIFYED_TIME='%0', FAVORITES=%1 WHERE DESKTOP_FILE_PATH=:desktopFilePath") cmd = QString("UPDATE APPINFO SET MODIFYED_TIME='%0', FAVORITES=%1 WHERE DESKTOP_FILE_PATH=:desktopFilePath")
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")) .arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"))
.arg(num); .arg(num);