another approach to fixing modSchema bug

start the progress dialog immediately so that askUser()
becomes part of the progress dialog's modality

the problem with the previous approach was that beginReset() attempts
to save the note again, leading to schema mismatches
This commit is contained in:
Damien Elmes 2016-07-12 13:53:59 +10:00
parent 166c6f4b3c
commit 85215018a5

View file

@ -1671,8 +1671,7 @@ Are you sure you want to continue?""")):
QDialog.accept(self) QDialog.accept(self)
self.browser.mw.checkpoint(_("Change Note Type")) self.browser.mw.checkpoint(_("Change Note Type"))
b = self.browser b = self.browser
b.mw.col.modSchema(check=True) b.mw.progress.start(immediate=True)
b.mw.progress.start()
b.model.beginReset() b.model.beginReset()
mm = b.mw.col.models mm = b.mw.col.models
mm.change(self.oldModel, self.nids, self.targetModel, fmap, cmap) mm.change(self.oldModel, self.nids, self.targetModel, fmap, cmap)