mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 06:07:11 -05:00
Ensuring value of sortBackwards is a Boolean
As far as Python is concerned, this commit does not change anything at all. The purpose of this commit is to avoid a rare bug in AnkiDroid. https://github.com/ankidroid/Anki-Android/issues/5523 Indeed, because of hh.sortIndicatorChanged.connect(self.onSortChanged), onSortChanged may be called with the values 0 or 1 instead of True or False. Which means than the method getBoolean in Ankidroid may throw an exception, stating that the value is an integer and not a Boolean.
This commit is contained in:
parent
0ffb308004
commit
35f42523d5
1 changed files with 1 additions and 0 deletions
|
|
@ -701,6 +701,7 @@ class Browser(QMainWindow):
|
|||
hh.sectionMoved.connect(self.onColumnMoved)
|
||||
|
||||
def onSortChanged(self, idx, ord):
|
||||
ord = bool(ord)
|
||||
self.editor.saveNow(lambda: self._onSortChanged(idx, ord))
|
||||
|
||||
def _onSortChanged(self, idx, ord):
|
||||
|
|
|
|||
Loading…
Reference in a new issue