mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Use replace instead of strip
https://github.com/ankitects/anki/pull/801
This commit is contained in:
parent
87770db7f1
commit
6d68bfa594
3 changed files with 4 additions and 4 deletions
|
@ -581,7 +581,7 @@ class CardLayout(QDialog):
|
|||
|
||||
def onRename(self):
|
||||
template = self.current_template()
|
||||
name = getOnlyText(_("New name:"), default=template["name"]).strip('"')
|
||||
name = getOnlyText(_("New name:"), default=template["name"]).replace('"', "")
|
||||
if not name.strip():
|
||||
return
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ class FieldDialog(QDialog):
|
|||
self.loadField(idx)
|
||||
|
||||
def _uniqueName(self, prompt, ignoreOrd=None, old=""):
|
||||
txt = getOnlyText(prompt, default=old).strip('"')
|
||||
txt = getOnlyText(prompt, default=old).replace('"', "")
|
||||
if not txt:
|
||||
return
|
||||
for f in self.model["flds"]:
|
||||
|
|
|
@ -85,7 +85,7 @@ class Models(QDialog):
|
|||
def onRename(self) -> None:
|
||||
nt = self.current_notetype()
|
||||
txt = getText(_("New name:"), default=nt["name"])
|
||||
name = txt[0].strip('"')
|
||||
name = txt[0].replace('"', "")
|
||||
if txt[1] and name:
|
||||
nt["name"] = name
|
||||
self.saveAndRefresh(nt)
|
||||
|
@ -120,7 +120,7 @@ class Models(QDialog):
|
|||
def onAdd(self) -> None:
|
||||
m = AddModel(self.mw, self).get()
|
||||
if m:
|
||||
txt = getText(_("Name:"), default=m["name"])[0].strip('"')
|
||||
txt = getText(_("Name:"), default=m["name"])[0].replace('"', "")
|
||||
if txt:
|
||||
m["name"] = txt
|
||||
self.saveAndRefresh(m)
|
||||
|
|
Loading…
Reference in a new issue