mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
don't error out if ret hit in tag list before selection visible
This commit is contained in:
parent
37490f1046
commit
edc680b2ea
1 changed files with 3 additions and 0 deletions
|
@ -59,6 +59,7 @@ class TagCompleter(QCompleter):
|
||||||
QCompleter.__init__(self, model, parent)
|
QCompleter.__init__(self, model, parent)
|
||||||
self.tags = []
|
self.tags = []
|
||||||
self.edit = edit
|
self.edit = edit
|
||||||
|
self.cursor = None
|
||||||
|
|
||||||
def splitPath(self, str):
|
def splitPath(self, str):
|
||||||
str = unicode(str).strip()
|
str = unicode(str).strip()
|
||||||
|
@ -70,6 +71,8 @@ class TagCompleter(QCompleter):
|
||||||
return QStringList(self.tags[self.cursor])
|
return QStringList(self.tags[self.cursor])
|
||||||
|
|
||||||
def pathFromIndex(self, idx):
|
def pathFromIndex(self, idx):
|
||||||
|
if not self.cursor:
|
||||||
|
return self.edit.text()
|
||||||
ret = QCompleter.pathFromIndex(self, idx)
|
ret = QCompleter.pathFromIndex(self, idx)
|
||||||
self.tags[self.cursor] = unicode(ret)
|
self.tags[self.cursor] = unicode(ret)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue