Skip to content

Commit 301e58a

Browse files
committed
fix: Fix cannot delete damaged thumbnails issue
First it does not action delete shortcut, and then without remove info from db if remove from album that cause the damaged thumbnails still show even refresh. Log: Fix cannot delete damaged thumbnails issue. Bug: https://pms.uniontech.com/bug-view-289217.html
1 parent 20a7a03 commit 301e58a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/qml/ThumbnailImageView/ThumbnailImage.qml

+7-2
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,20 @@ Item {
9999
}
100100

101101
Shortcut {
102-
enabled: visible && menuItemStates.canDelete && GStatus.currentViewType !== Album.Types.ViewDevice
102+
enabled: visible && GStatus.currentViewType !== Album.Types.ViewDevice
103103
autoRepeat: false
104104
sequence : "Delete"
105105
onActivated : {
106106
if (menuItemStates.isInTrash) {
107107
deleteDialog.setDisplay(menuItemStates.isInTrash ? Album.Types.TrashSel : Album.Types.TrashNormal, GStatus.selectedPaths.length)
108108
deleteDialog.show()
109109
} else {
110-
deleteDialog.deleteDirectly()
110+
if (menuItemStates.canDelete) {
111+
deleteDialog.deleteDirectly()
112+
} else {
113+
// 源文件已不存在,从相册移除裂图
114+
menuItemStates.executeRemoveFromAlbum()
115+
}
111116
}
112117
}
113118
}

src/src/albumControl.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1810,6 +1810,9 @@ void AlbumControl::removeFromAlbum(int UID, const QStringList &paths)
18101810
DBManager::instance()->removeCustomAlbumIdByPaths(UID, localPaths);
18111811

18121812
DBManager::instance()->removeFromAlbum(UID, localPaths, atype);
1813+
1814+
// 删除信息使更新显示时不显示该图片
1815+
DBManager::instance()->removeImgInfos(localPaths);
18131816
}
18141817

18151818
bool AlbumControl::insertIntoAlbum(int UID, const QStringList &paths)

0 commit comments

Comments
 (0)