AddonManager: Fixed crash when quickly clicking through addons

This commit is contained in:
Yorik van Havre
2019-10-10 14:56:28 -03:00
parent 728eedc038
commit f946cfaaa4
2 changed files with 15 additions and 1 deletions

View File

@@ -407,13 +407,20 @@ class ShowWorker(QtCore.QThread):
self.info_label.emit( message )
self.progressbar_show.emit(False)
self.mustLoadImages = True
l = self.loadImages( message, self.repos[self.idx][1], self.repos[self.idx][0])
if l:
self.info_label.emit( l )
self.stop = True
def stopImageLoading(self):
"this stops the image loading process and allow the thread to terminate earlier"
self.mustLoadImages = False
def loadImages(self,message,url,wbName):
"checks if the given page contains images and downloads them"
# QTextBrowser cannot display online images. So we download them
@@ -427,6 +434,8 @@ class ShowWorker(QtCore.QThread):
if not os.path.exists(store):
os.makedirs(store)
for path in imagepaths:
if not self.mustLoadImages:
return None
origpath = path
if "?" in path:
# remove everything after the ?