This commit is contained in:
Damien Elmes 2014-07-23 20:15:29 +09:00
commit 908c514e58
2 changed files with 8 additions and 4 deletions

View file

@ -449,9 +449,6 @@ class Editor(object):
txt = self.mungeHTML(txt)
# misbehaving apps may include a null byte in the text
txt = txt.replace("\x00", "")
# reverse the url quoting we added to get images to display
txt = unicode(urllib2.unquote(
txt.encode("utf8")), "utf8", "replace")
self.note.fields[self.currentField] = txt
if not self.addMode:
self.note.flush()

View file

@ -224,7 +224,14 @@ and no other programs are accessing your profile folders, then try again."""))
return p
else:
loc = QDesktopServices.storageLocation(QDesktopServices.DocumentsLocation)
return os.path.join(loc, "Anki")
if loc[:-1] == QDesktopServices.storageLocation(
QDesktopServices.HomeLocation):
# occasionally "documentsLocation" will return the home
# folder because the Documents folder isn't configured
# properly; fall back to an English path
return os.path.expanduser("~/Documents/Anki")
else:
return os.path.join(loc, "Anki")
def _loadMeta(self):
path = os.path.join(self.base, "prefs.db")