mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-03 14:03:06 +02:00
...
This commit is contained in:
parent
3bca088525
commit
152af5efce
1 changed files with 2 additions and 3 deletions
|
|
@ -9,7 +9,7 @@
|
|||
from PyQt4.Qt import (QLineEdit, QAbstractListModel, Qt,
|
||||
QApplication, QCompleter)
|
||||
|
||||
from calibre.utils.icu import sort_key, lower
|
||||
from calibre.utils.icu import sort_key
|
||||
from calibre.gui2 import NONE
|
||||
from calibre.gui2.widgets import EnComboBox, LineEditECM
|
||||
from calibre.utils.config_base import tweaks
|
||||
|
|
@ -24,12 +24,11 @@ def __init__(self, parent=None):
|
|||
def set_items(self, items):
|
||||
items = [unicode(x.strip()) for x in items]
|
||||
if len(items) < tweaks['completion_change_to_ascii_sorting']:
|
||||
self.items = sorted(items, key=lambda x: sort_key(x))
|
||||
self.items = sorted(items, key=sort_key)
|
||||
self.sorting = QCompleter.UnsortedModel
|
||||
else:
|
||||
self.items = sorted(items, key=lambda x:x.lower())
|
||||
self.sorting = QCompleter.CaseInsensitivelySortedModel
|
||||
self.lowered_items = [lower(x) for x in self.items]
|
||||
self.reset()
|
||||
|
||||
def rowCount(self, *args):
|
||||
|
|
|
|||
Loading…
Reference in a new issue