mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
trigger 'refresh_finished' signal out of 'run' method
This commit is contained in:
parent
7ea9b25074
commit
c189cee759
1 changed files with 4 additions and 1 deletions
|
|
@ -15,6 +15,7 @@ class RefreshThread(QtCore.QThread):
|
|||
self._callback = partial(func, *args, **kwargs)
|
||||
self._exception = None
|
||||
self._result = None
|
||||
self.finished.connect(self._on_finish_callback)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
|
|
@ -29,11 +30,13 @@ class RefreshThread(QtCore.QThread):
|
|||
self._result = self._callback()
|
||||
except Exception as exc:
|
||||
self._exception = exc
|
||||
self.refresh_finished.emit(self.id)
|
||||
|
||||
def get_result(self):
|
||||
return self._result
|
||||
|
||||
def _on_finish_callback(self):
|
||||
self.refresh_finished.emit(self.id)
|
||||
|
||||
|
||||
class _IconsCache:
|
||||
"""Cache for icons."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue