mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +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._callback = partial(func, *args, **kwargs)
|
||||||
self._exception = None
|
self._exception = None
|
||||||
self._result = None
|
self._result = None
|
||||||
|
self.finished.connect(self._on_finish_callback)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def id(self):
|
def id(self):
|
||||||
|
|
@ -29,11 +30,13 @@ class RefreshThread(QtCore.QThread):
|
||||||
self._result = self._callback()
|
self._result = self._callback()
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
self._exception = exc
|
self._exception = exc
|
||||||
self.refresh_finished.emit(self.id)
|
|
||||||
|
|
||||||
def get_result(self):
|
def get_result(self):
|
||||||
return self._result
|
return self._result
|
||||||
|
|
||||||
|
def _on_finish_callback(self):
|
||||||
|
self.refresh_finished.emit(self.id)
|
||||||
|
|
||||||
|
|
||||||
class _IconsCache:
|
class _IconsCache:
|
||||||
"""Cache for icons."""
|
"""Cache for icons."""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue