load sidebar in background
Allows the UI to repaint during processing, but will still block DB operations until the call completes.
This commit is contained in:
parent
31a3add848
commit
a82744a3e5
@ -219,10 +219,13 @@ class SidebarTreeView(QTreeView):
|
||||
if not self.isVisible():
|
||||
return
|
||||
|
||||
root = self._root_tree()
|
||||
model = SidebarModel(root)
|
||||
self.setModel(model)
|
||||
model.expandWhereNeccessary(self)
|
||||
def on_done(fut: Future):
|
||||
root = fut.result()
|
||||
model = SidebarModel(root)
|
||||
self.setModel(model)
|
||||
model.expandWhereNeccessary(self)
|
||||
|
||||
self.mw.taskman.run_in_background(self._root_tree, on_done)
|
||||
|
||||
def onClickCurrent(self) -> None:
|
||||
idx = self.currentIndex()
|
||||
|
Loading…
Reference in New Issue
Block a user