From 7f2267d72a321a8bfce28b883c6fef2fbda4991e Mon Sep 17 00:00:00 2001 From: JunjieBai Date: Wed, 15 Feb 2023 09:45:21 +0800 Subject: [PATCH] Fix the problem that the top and favorite state cannot be set to 0. --- ukui-search-app-data-service/app-db-manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ukui-search-app-data-service/app-db-manager.cpp b/ukui-search-app-data-service/app-db-manager.cpp index 79ac926..f06806b 100644 --- a/ukui-search-app-data-service/app-db-manager.cpp +++ b/ukui-search-app-data-service/app-db-manager.cpp @@ -891,7 +891,7 @@ bool AppDBManager::handleFavoritesStateUpdate(const QString &desktopfp, int num) qWarning() << "Fail to exec:" << cmd << "because:" << m_database.lastError(); } else { while (sql.next()) { - if (sql.value("FAVORITES").toInt() == num) { + if (num && sql.value("FAVORITES").toInt() == num) { res = false; if (sql.value("DESKTOP_FILE_PATH").toString() == desktopfp) { qWarning() << "favorites state has no changes, I quit!"; @@ -938,7 +938,7 @@ bool AppDBManager::handleTopStateUpdate(const QString &desktopfp, int num) qWarning() << "Fail to exec:" << cmd << "because:" << m_database.lastError(); } else { while (sql.next()) { - if (sql.value("TOP").toInt() == num) { + if (num && sql.value("TOP").toInt() == num) { res = false; if (sql.value("DESKTOP_FILE_PATH").toString() == desktopfp) { qWarning() << "top state has no changes, I quit!";