mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -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"):
|
help="DeckBrowser"):
|
||||||
self.config['recentDeckPaths'].remove(self.browserDecks[c]['path'])
|
self.config['recentDeckPaths'].remove(self.browserDecks[c]['path'])
|
||||||
del self.browserDecks[c]
|
del self.browserDecks[c]
|
||||||
self.showDeckBrowser()
|
self.doLater(100, self.showDeckBrowser)
|
||||||
|
|
||||||
def onDeckBrowserDelete(self, c):
|
def onDeckBrowserDelete(self, c):
|
||||||
deck = self.browserDecks[c]['path']
|
deck = self.browserDecks[c]['path']
|
||||||
|
@ -1353,11 +1353,17 @@ later by using File>Close.
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
self.config['recentDeckPaths'].remove(deck)
|
self.config['recentDeckPaths'].remove(deck)
|
||||||
self.showDeckBrowser()
|
self.doLater(100, self.showDeckBrowser)
|
||||||
|
|
||||||
def onDeckBrowserForgetInaccessible(self):
|
def onDeckBrowserForgetInaccessible(self):
|
||||||
self.refreshBrowserDecks(forget=True)
|
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
|
# Opening and closing the app
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue