don't error out if ret hit in tag list before selection visible

This commit is contained in:
Damien Elmes 2010-02-18 17:23:21 +09:00
parent 37490f1046
commit edc680b2ea

View file

@ -59,6 +59,7 @@ class TagCompleter(QCompleter):
QCompleter.__init__(self, model, parent)
self.tags = []
self.edit = edit
self.cursor = None
def splitPath(self, str):
str = unicode(str).strip()
@ -70,6 +71,8 @@ class TagCompleter(QCompleter):
return QStringList(self.tags[self.cursor])
def pathFromIndex(self, idx):
if not self.cursor:
return self.edit.text()
ret = QCompleter.pathFromIndex(self, idx)
self.tags[self.cursor] = unicode(ret)
try: