Fix #1842183 [calibre.exe uses CPU during idle with Download cover popup window open](https://bugs.launchpad.net/calibre/+bug/1842183)

This commit is contained in:
Kovid Goyal 2019-09-01 06:16:34 +05:30
parent 8281ab4318
commit 0b03e331c2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -557,7 +557,7 @@ class IdentifyWidget(QWidget): # {{{
class CoverWorker(Thread): # {{{ class CoverWorker(Thread): # {{{
def __init__(self, log, abort, title, authors, identifiers, caches): def __init__(self, log, abort, title, authors, identifiers, caches):
Thread.__init__(self) Thread.__init__(self, name='CoverWorker')
self.daemon = True self.daemon = True
self.log, self.abort = log, abort self.log, self.abort = log, abort
@ -813,6 +813,9 @@ class CoversView(QListView): # {{{
self.select(0) self.select(0)
self.delegate.start_animation() self.delegate.start_animation()
def stop(self):
self.delegate.stop_animation()
def reset_covers(self): def reset_covers(self):
self.m.reset_covers() self.m.reset_covers()
@ -937,6 +940,7 @@ class CoversWidget(QWidget): # {{{
title=self.title) title=self.title)
self.msg.setText(txt) self.msg.setText(txt)
self.msg.setWordWrap(True) self.msg.setWordWrap(True)
self.covers_view.stop()
self.finished.emit() self.finished.emit()
@ -1193,7 +1197,8 @@ class CoverFetch(QDialog): # {{{
if __name__ == '__main__': if __name__ == '__main__':
from calibre.gui2 import Application
DEBUG_DIALOG = True DEBUG_DIALOG = True
app = QApplication([]) app = Application([])
d = FullFetch() d = FullFetch()
d.start(title='great gatsby', authors=['fitzgerald']) d.start(title='great gatsby', authors=['fitzgerald'], identifiers={})