workaround for import into new deck on win32

This commit is contained in:
Damien Elmes 2009-01-24 21:25:55 +09:00
parent 582f89155d
commit 5e1c98d516

View file

@ -1,7 +1,7 @@
# Copyright: Damien Elmes <anki@ichi2.net> # Copyright: Damien Elmes <anki@ichi2.net>
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html # License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
import os, copy, time import os, copy, time, sys
from PyQt4.QtGui import * from PyQt4.QtGui import *
from PyQt4.QtCore import * from PyQt4.QtCore import *
import anki import anki
@ -140,6 +140,10 @@ class ImportDialog(QDialog):
self.dialog.status.setText(txt) self.dialog.status.setText(txt)
self.file = None self.file = None
self.maybePreview() self.maybePreview()
self.parent.deck.s.flush()
if sys.platform.startswith("win32") and not self.parent.deck.path:
# this fixes a strange bug in sqlite
self.parent.deck.s.all("pragma integrity_check")
self.parent.reset() self.parent.reset()
def setupMappingFrame(self): def setupMappingFrame(self):