[ui] clear thumbnail requests when changing viewpoints

This commit is contained in:
mugulmd 2023-01-17 07:11:32 -08:00
parent ae3184decc
commit dd235dcbf1
2 changed files with 12 additions and 0 deletions

View file

@ -271,3 +271,11 @@ class ThumbnailCache(QObject):
# No more request to process
# Unregister worker thread
ThumbnailCache.activeWorkerThreads -= 1
@Slot()
def clearRequests(self):
"""Clear all pending thumbnail creation requests.
Requests already under treatment by a worker thread will still be completed.
"""
ThumbnailCache.requests.clear()

View file

@ -39,6 +39,10 @@ Panel {
property variant viewpoints: currentCameraInit ? currentCameraInit.attribute('viewpoints').value : undefined
property variant intrinsics: currentCameraInit ? currentCameraInit.attribute('intrinsics').value : undefined
property bool readOnly: root.readOnly || displayHDR.checked
onViewpointsChanged: {
ThumbnailCache.clearRequests();
}
}
property variant parsedIntrinsic