mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Merge branch 'master' of https://github.com/dae/anki
This commit is contained in:
commit
3ebbc1e2b7
3 changed files with 9 additions and 3 deletions
|
@ -161,6 +161,7 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
|
||||||
self.db.close()
|
self.db.close()
|
||||||
self.db = None
|
self.db = None
|
||||||
self.media.close()
|
self.media.close()
|
||||||
|
self._closeLog()
|
||||||
|
|
||||||
def reopen(self):
|
def reopen(self):
|
||||||
"Reconnect to DB (after changing threads, etc)."
|
"Reconnect to DB (after changing threads, etc)."
|
||||||
|
@ -168,6 +169,7 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
|
||||||
if not self.db:
|
if not self.db:
|
||||||
self.db = anki.db.DB(self.path)
|
self.db = anki.db.DB(self.path)
|
||||||
self.media.connect()
|
self.media.connect()
|
||||||
|
self._openLog()
|
||||||
|
|
||||||
def rollback(self):
|
def rollback(self):
|
||||||
self.db.rollback()
|
self.db.rollback()
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
import urllib
|
import urllib
|
||||||
import unicodedata
|
import unicodedata
|
||||||
|
@ -505,8 +504,12 @@ create table log (fname text primary key, type int);
|
||||||
need = []
|
need = []
|
||||||
remove = []
|
remove = []
|
||||||
for f in files:
|
for f in files:
|
||||||
if self.db.scalar("select 1 from log where fname=?", f):
|
if isMac:
|
||||||
remove.append((f,))
|
name = unicodedata.normalize("NFD", f)
|
||||||
|
else:
|
||||||
|
name = f
|
||||||
|
if self.db.scalar("select 1 from log where fname=?", name):
|
||||||
|
remove.append((name,))
|
||||||
else:
|
else:
|
||||||
need.append(f)
|
need.append(f)
|
||||||
self.db.executemany("delete from log where fname=?", remove)
|
self.db.executemany("delete from log where fname=?", remove)
|
||||||
|
|
|
@ -638,6 +638,7 @@ class Browser(QMainWindow):
|
||||||
noSort = ("question", "answer", "template", "deck", "note", "noteTags")
|
noSort = ("question", "answer", "template", "deck", "note", "noteTags")
|
||||||
if type in noSort:
|
if type in noSort:
|
||||||
if type == "template":
|
if type == "template":
|
||||||
|
# fixme: change to 'card:1' to be clearer in future dev round
|
||||||
showInfo(_("""\
|
showInfo(_("""\
|
||||||
This column can't be sorted on, but you can search for individual card types, \
|
This column can't be sorted on, but you can search for individual card types, \
|
||||||
such as 'card:Card 1'."""))
|
such as 'card:Card 1'."""))
|
||||||
|
|
Loading…
Reference in a new issue