Limit selection in completion popup to boxes containing less than completion_change_to_ascii_sorting items

This commit is contained in:
Charles Haley 2012-07-02 16:00:30 +02:00
parent 1d9285df7a
commit 7b502b06f7

View File

@ -168,13 +168,14 @@ class MultiCompleteComboBox(EnComboBox):
v = unicode(c.currentCompletion()) v = unicode(c.currentCompletion())
c.setCompletionPrefix('') c.setCompletionPrefix('')
c.complete() c.complete()
i = 0; if c.model().rowCount() < tweaks['completion_change_to_ascii_sorting']:
while c.setCurrentRow(i): i = 0;
cr = unicode(c.currentIndex().data().toString()) while c.setCurrentRow(i):
if cr.startswith(v): cr = unicode(c.currentIndex().data().toString())
c.popup().setCurrentIndex(c.currentIndex()) if cr.startswith(v):
return c.popup().setCurrentIndex(c.currentIndex())
i += 1 break
i += 1
def update_items_cache(self, complete_items): def update_items_cache(self, complete_items):
self.lineEdit().update_items_cache(complete_items) self.lineEdit().update_items_cache(complete_items)