This commit is contained in:
Soren I. Bjornstad 2013-12-04 10:31:05 -06:00
commit 3ebbc1e2b7
3 changed files with 9 additions and 3 deletions

View file

@ -161,6 +161,7 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
self.db.close()
self.db = None
self.media.close()
self._closeLog()
def reopen(self):
"Reconnect to DB (after changing threads, etc)."
@ -168,6 +169,7 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
if not self.db:
self.db = anki.db.DB(self.path)
self.media.connect()
self._openLog()
def rollback(self):
self.db.rollback()

View file

@ -2,7 +2,6 @@
# Copyright: Damien Elmes <anki@ichi2.net>
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import os
import re
import urllib
import unicodedata
@ -505,8 +504,12 @@ create table log (fname text primary key, type int);
need = []
remove = []
for f in files:
if self.db.scalar("select 1 from log where fname=?", f):
remove.append((f,))
if isMac:
name = unicodedata.normalize("NFD", f)
else:
name = f
if self.db.scalar("select 1 from log where fname=?", name):
remove.append((name,))
else:
need.append(f)
self.db.executemany("delete from log where fname=?", remove)

View file

@ -638,6 +638,7 @@ class Browser(QMainWindow):
noSort = ("question", "answer", "template", "deck", "note", "noteTags")
if type in noSort:
if type == "template":
# fixme: change to 'card:1' to be clearer in future dev round
showInfo(_("""\
This column can't be sorted on, but you can search for individual card types, \
such as 'card:Card 1'."""))