mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 08:22:24 -04:00
fix race condition in deck browser signal handlers
This commit is contained in:
parent
e3f50540d5
commit
c9010e984e
1 changed files with 8 additions and 2 deletions
|
@ -1341,7 +1341,7 @@ later by using File>Close.
|
|||
help="DeckBrowser"):
|
||||
self.config['recentDeckPaths'].remove(self.browserDecks[c]['path'])
|
||||
del self.browserDecks[c]
|
||||
self.showDeckBrowser()
|
||||
self.doLater(100, self.showDeckBrowser)
|
||||
|
||||
def onDeckBrowserDelete(self, c):
|
||||
deck = self.browserDecks[c]['path']
|
||||
|
@ -1353,11 +1353,17 @@ later by using File>Close.
|
|||
except OSError:
|
||||
pass
|
||||
self.config['recentDeckPaths'].remove(deck)
|
||||
self.showDeckBrowser()
|
||||
self.doLater(100, self.showDeckBrowser)
|
||||
|
||||
def onDeckBrowserForgetInaccessible(self):
|
||||
self.refreshBrowserDecks(forget=True)
|
||||
|
||||
def doLater(self, msecs, func):
|
||||
timer = QTimer(self)
|
||||
timer.setSingleShot(True)
|
||||
timer.start(msecs)
|
||||
self.connect(timer, SIGNAL("timeout()"), func)
|
||||
|
||||
# Opening and closing the app
|
||||
##########################################################################
|
||||
|
||||
|
|
Loading…
Reference in a new issue