#535 do the forced update check via a (non-blocking) QThread

This commit is contained in:
Miguel Jacq 2018-01-23 16:32:14 +11:00
parent 95c8c0fb81
commit 70a624c331
No known key found for this signature in database
GPG key ID: 5418373DFF79BA19
2 changed files with 25 additions and 21 deletions

View file

@ -149,11 +149,12 @@ class UpdateThread(QtCore.QThread):
update_available = QtCore.pyqtSignal(str, str, str)
update_not_available = QtCore.pyqtSignal()
def __init__(self, onion, config=False):
def __init__(self, onion, config=False, force=False):
super(UpdateThread, self).__init__()
common.log('UpdateThread', '__init__')
self.onion = onion
self.config = config
self.force = force
def run(self):
common.log('UpdateThread', 'run')
@ -163,7 +164,7 @@ class UpdateThread(QtCore.QThread):
u.update_not_available.connect(self._update_not_available)
try:
u.check(config=self.config)
u.check(config=self.config,force=self.force)
except Exception as e:
# If update check fails, silently ignore
common.log('UpdateThread', 'run', '{}'.format(e))