mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 00:36:38 -04:00
don't call toString() on registry results; don't cast QUrl.toString()
This commit is contained in:
parent
f0311d1ecb
commit
3a4443404b
4 changed files with 6 additions and 7 deletions
|
@ -1206,7 +1206,7 @@ select fm.id, fm.name from fieldmodels fm""")
|
|||
self.deck.finishProgress()
|
||||
|
||||
def dupeLinkClicked(self, link):
|
||||
self.form.searchEdit.setText(str(link.toString()))
|
||||
self.form.searchEdit.setText(link.toString())
|
||||
self.onSearch()
|
||||
self.onFact()
|
||||
|
||||
|
|
|
@ -808,7 +808,7 @@ class EditorWebView(AnkiWebView):
|
|||
if not oldmime.hasHtml() and oldmime.hasUrls():
|
||||
# qt gives it to us twice
|
||||
txt += '<img src="%s">' % os.path.basename(
|
||||
unicode(oldmime.urls()[0].toString()))
|
||||
oldmime.urls()[0].toString())
|
||||
mime.setHtml(txt)
|
||||
else:
|
||||
mime.setHtml(oldmime.html())
|
||||
|
@ -874,7 +874,7 @@ class EditorWebView(AnkiWebView):
|
|||
def _processUrls(self, mime):
|
||||
links = []
|
||||
for url in mime.urls():
|
||||
url = unicode(url.toString())
|
||||
url = url.toString()
|
||||
link = self._retrieveURL(url)
|
||||
if link:
|
||||
links.append(link)
|
||||
|
|
|
@ -992,8 +992,7 @@ sync will overwrite any remote changes. Continue?"""))
|
|||
if isWin:
|
||||
s = QSettings(QSettings.UserScope, "Microsoft", "Windows")
|
||||
s.beginGroup("CurrentVersion/Explorer/Shell Folders")
|
||||
p = os.path.join(unicode(s.value("Personal").toString()),
|
||||
"My Dropbox")
|
||||
p = os.path.join(s.value("Personal"), "My Dropbox")
|
||||
else:
|
||||
p = os.path.expanduser("~/Dropbox")
|
||||
return p
|
||||
|
@ -1168,7 +1167,7 @@ It can take a long time. Proceed?""")):
|
|||
if isWin:
|
||||
s = QSettings(QSettings.UserScope, "Microsoft", "Windows")
|
||||
s.beginGroup("CurrentVersion/Explorer/Shell Folders")
|
||||
d = unicode(s.value("Personal").toString())
|
||||
d = s.value("Personal")
|
||||
if os.path.exists(d):
|
||||
d = os.path.join(d, "Anki")
|
||||
else:
|
||||
|
|
|
@ -101,7 +101,7 @@ class AnkiWebView(QWebView):
|
|||
def _jsErr(self, msg, line, srcID):
|
||||
sys.stderr.write(_("JS error on line %d: %s") % (line, msg+"\n"))
|
||||
def _linkHandler(self, url):
|
||||
self.linkHandler(unicode(url.toString()))
|
||||
self.linkHandler(url.toString())
|
||||
def _loadFinished(self):
|
||||
self.page().mainFrame().addToJavaScriptWindowObject("py", self._bridge)
|
||||
if self._loadFinishedCB:
|
||||
|
|
Loading…
Reference in a new issue