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) txt = self.mungeHTML(txt)
# misbehaving apps may include a null byte in the text # misbehaving apps may include a null byte in the text
txt = txt.replace("\x00", "") 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 self.note.fields[self.currentField] = txt
if not self.addMode: if not self.addMode:
self.note.flush() self.note.flush()

View file

@ -224,6 +224,13 @@ and no other programs are accessing your profile folders, then try again."""))
return p return p
else: else:
loc = QDesktopServices.storageLocation(QDesktopServices.DocumentsLocation) loc = QDesktopServices.storageLocation(QDesktopServices.DocumentsLocation)
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") return os.path.join(loc, "Anki")
def _loadMeta(self): def _loadMeta(self):