improved completor performance

This commit is contained in:
Andreas Preikschat 2010-12-03 20:54:40 +01:00
commit 9a67a74ab9

View File

@ -451,10 +451,12 @@ class BibleMediaItem(MediaManagerItem):
books = []
# We have to do a 'Verse Search'.
if self.QuickSearchComboBox.currentIndex() == 0:
bibles = self.parent.manager.get_bibles()
bible = unicode(self.QuickVersionComboBox.currentText())
if bible:
book_data = self.parent.manager.get_books(bible)
books = [book[u'name'] for book in book_data]
book_data = bibles[bible].get_books()
books = [book.name for book in book_data]
books.sort()
completer = QtGui.QCompleter(books)
completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
self.QuickSearchEdit.setCompleter(completer)