anki/qt/aqt
evandrocoan f78166cda2 Fixed previewer.py::render_card() being called twice in row
Related to: https://github.com/ankitects/anki/pull 529
Ensuring "setNote" is called only once during changing of note type

After debugging the code, every time the cards changes, there are
two stacktraces generated and triggered when note cards change:

calling 1590591251.4621403
   File "qt/runanki", line 4, in <module>
  File "F:\anki\qt\aqt\__init__.py", line 365, in run
    _run()
  File "F:\anki\qt\aqt\__init__.py", line 515, in _run
    app.exec()
  File "F:\anki\qt\aqt\webview.py", line 467, in handler
    cb(val)
  File "F:\anki\qt\aqt\editor.py", line 477, in <lambda>
    self.web.evalWithCallback("saveNow(%d)" % keepFocus, lambda res: callback())
  File "F:\anki\qt\aqt\browser.py", line 858, in <lambda>
    self.editor.saveNow(lambda: self._onRowChanged(current, previous))
  File "F:\anki\qt\aqt\browser.py", line 880, in _onRowChanged
    self._renderPreview(True)
  File "F:\anki\qt\aqt\browser.py", line 1576, in _renderPreview
    self._previewer.render_card(cardChanged)
  File "F:\anki\qt\aqt\previewer.py", line 136, in render_card
    print('calling', time.time(), "\n", "".join( traceback.format_stack() ) )

calling 1590591251.4766161
   File "qt/runanki", line 4, in <module>
  File "F:\anki\qt\aqt\__init__.py", line 365, in run
    _run()
  File "F:\anki\qt\aqt\__init__.py", line 515, in _run
    app.exec()
  File "F:\anki\qt\aqt\webview.py", line 467, in handler
    cb(val)
  File "F:\anki\qt\aqt\editor.py", line 453, in oncallback
    gui_hooks.editor_did_load_note(self)
  File "F:\anki\qt\aqt\gui_hooks.py", line 1168, in __call__
    hook(editor)
  File "F:\anki\qt\aqt\browser.py", line 887, in onLoadNote
    self.refreshCurrentCard(editor.note)
  File "F:\anki\qt\aqt\browser.py", line 884, in refreshCurrentCard
    self._renderPreview(False)
  File "F:\anki\qt\aqt\browser.py", line 1576, in _renderPreview
    self._previewer.render_card(cardChanged)
  File "F:\anki\qt\aqt\previewer.py", line 136, in render_card
    print('calling', time.time(), "\n", "".join( traceback.format_stack() ) )
2020-05-27 14:41:07 -03:00
..
__init__.py Merge pull request #610 from evandroforks/ask_confirmation_before_moving_anki_collection 2020-05-18 19:44:27 +10:00
.gitignore basic night mode support 2020-01-23 17:27:07 +10:00
about.py use qconnect everywhere, and fix some typing issues 2020-05-04 13:23:08 +10:00
addcards.py deprecate removeTempNote() 2020-05-20 15:01:05 +10:00
addons.py use qconnect everywhere, and fix some typing issues 2020-05-04 13:23:08 +10:00
browser.py Fixed previewer.py::render_card() being called twice in row 2020-05-27 14:41:07 -03:00
clayout.py use keyword args for calls with more than one argument 2020-05-24 09:12:47 +10:00
customstudy.py fix custom study not saving 2020-05-22 11:25:11 +10:00
deckbrowser.py use keyword args for calls with more than one argument 2020-05-24 09:12:47 +10:00
deckchooser.py correct missing french translation 2020-02-05 20:48:30 -08:00
deckconf.py Add three deck config hooks 2020-05-22 21:24:05 +02:00
dyndeckconf.py use qconnect everywhere, and fix some typing issues 2020-05-04 13:23:08 +10:00
editcurrent.py add qconnect helper and some type hints 2020-01-16 07:41:23 +10:00
editor.py remove unused variable 'w' from '_onHtmlEdit' 2020-05-27 12:04:49 +02:00
emptycards.py more methods 2020-05-23 14:01:36 +10:00
errors.py use qconnect everywhere, and fix some typing issues 2020-05-04 13:23:08 +10:00
exporting.py handle default deck and filtered deck suppression in the backend 2020-05-15 21:21:10 +10:00
fields.py do nothing if dropPos == idx 2020-05-26 18:59:53 +09:00
gui_hooks.py Satisfy black reformatter 2020-05-23 11:14:52 +02:00
importing.py Explicitly close the importer file descriptor 2020-05-18 15:54:20 -03:00
legacy.py use keyword args for calls with more than one argument 2020-05-24 09:12:47 +10:00
main.py storage->collection 2020-05-20 17:58:28 +10:00
mediacheck.py migrate more methods to service 2020-05-22 22:09:33 +10:00
mediasrv.py storage->collection 2020-05-20 17:58:28 +10:00
mediasync.py use keyword args for calls with more than one argument 2020-05-24 09:12:47 +10:00
modelchooser.py use qconnect everywhere, and fix some typing issues 2020-05-04 13:23:08 +10:00
models.py drop mw.weakref usage in models.py for now 2020-05-20 13:53:34 +10:00
mpv.py apply mpv fix 2020-05-27 09:19:20 +10:00
overview.py use deck tree for new/review count calculation 2020-05-16 20:28:03 +10:00
pinnedmodules.py python formatting+lints 2020-05-08 17:30:27 +10:00
preferences.py use keyword args for calls with more than one argument 2020-05-24 09:12:47 +10:00
previewer.py tidy up Qt import 2020-05-20 13:38:55 +10:00
profiles.py Add missing close file descriptors using context managers 2020-05-18 15:54:20 -03:00
progress.py use qconnect everywhere, and fix some typing issues 2020-05-04 13:23:08 +10:00
py.typed mark anki and aqt modules as having typing info 2020-01-13 13:03:37 +10:00
qt.py use qconnect everywhere, and fix some typing issues 2020-05-04 13:23:08 +10:00
reviewer.py don't hide static template text when card is empty 2020-05-13 11:17:44 +10:00
schema_change_tracker.py track changes in fields dialog as well 2020-05-15 13:59:44 +10:00
sound.py try mpv on Windows again 2020-05-27 09:21:41 +10:00
stats.py stats area grouping box fix 2020-05-08 16:03:29 +10:00
studydeck.py add typehint for eventFilter method 2020-05-26 17:08:55 +09:00
sync.py use qconnect everywhere, and fix some typing issues 2020-05-04 13:23:08 +10:00
tagedit.py handle default deck and filtered deck suppression in the backend 2020-05-15 21:21:10 +10:00
taglimit.py use qconnect everywhere, and fix some typing issues 2020-05-04 13:23:08 +10:00
taskman.py remove an unused import 2020-05-12 21:13:34 +10:00
theme.py pare back dark mode support 2020-04-15 21:44:56 +10:00
toolbar.py Monkeytype qt/aqt/toolbar.py 2020-03-01 10:16:08 -05:00
tts.py fix audio getting stuck (2/2) 2020-03-15 09:34:04 +10:00
update.py tweaking the folder names again 2020-01-03 07:48:38 +10:00
utils.py fix typechecking breaking with latest mypy_protobuf 2020-05-27 09:14:02 +10:00
webview.py Merge pull request #636 from BlueGreenMagick/typing-contextmenuevent 2020-05-27 10:23:44 +10:00
winpaths.py tweaking the folder names again 2020-01-03 07:48:38 +10:00