fix(issues:I9ITES):解决拖拽添加或右键添加到收藏区域,UI界面卡顿问题
This commit is contained in:
parent
709a413cf8
commit
4f084330f6
|
@ -129,9 +129,12 @@ void AppFavoritesModel::updateFavoritesApps(const DataEntity &app, const QModelI
|
|||
if (app.id().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
QPersistentModelIndex index(sourceIndex);
|
||||
|
||||
if (app.favorite() > 0 && !FavoriteFolderHelper::instance()->containApp(app.id())) {
|
||||
QPersistentModelIndex index(sourceIndex);
|
||||
if (m_favoritesApps.contains(index)) {
|
||||
return;
|
||||
}
|
||||
addFavoriteApp(index);
|
||||
FavoritesConfig::instance().insertValue(APP_ID_SCHEME + index.data(DataEntity::Id).toString());
|
||||
|
||||
|
@ -139,8 +142,6 @@ void AppFavoritesModel::updateFavoritesApps(const DataEntity &app, const QModelI
|
|||
if (FavoriteFolderHelper::instance()->containApp(app.id())) {
|
||||
FavoriteFolderHelper::instance()->removeAppFromFolder(app.id());
|
||||
}
|
||||
|
||||
QPersistentModelIndex index(sourceIndex);
|
||||
removeFavoriteApp(index);
|
||||
}
|
||||
}
|
||||
|
@ -365,6 +366,8 @@ void AppFavoritesModel::addAppToFavorites(const QString &id, const int &index)
|
|||
if (id.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
QPersistentModelIndex modelIndex(m_sourceModel->index(m_sourceModel->indexOfApp(id)));
|
||||
addFavoriteApp(modelIndex);
|
||||
|
||||
m_sourceModel->databaseInterface()->fixAppToFavorite(id, 1);
|
||||
|
||||
|
|
Loading…
Reference in New Issue