Title sort tweak.

This commit is contained in:
Charles Haley 2010-06-10 21:16:54 +01:00
parent d2677fc1bb
commit fe1316f201
3 changed files with 18 additions and 5 deletions

View File

@ -61,3 +61,13 @@ sort_columns_at_startup = None
# default if not set: MMM yyyy
gui_pubdate_display_format = 'MMM yyyy'
# Control title sorting.
# If set to 'library_order', Leading articles such as The and A will be ignored.
# If set to 'strictly_alphabetic', the titles will be sorted without processing
# For example, with library_order, The Client will sort under 'C'. With
# strictly_alphabetic, the book will sort under 'T'.
# This flag affects Calibre's library display. It has no effect on devices. In
# addition, books added before changing the flag will retain their order until
# the title is edited. Double-clicking on a title and hitting return without
# changing anything is sufficient to change the sort.
title_sorting = 'library_order'

View File

@ -43,10 +43,11 @@ def authors_to_sort_string(authors):
_title_pat = re.compile('^(A|The|An)\s+', re.IGNORECASE)
def title_sort(title):
match = _title_pat.search(title)
if match:
prep = match.group(1)
title = title[len(prep):] + ', ' + prep
if tweaks['title_sorting'] == 'library_order':
match = _title_pat.search(title)
if match:
prep = match.group(1)
title = title[len(prep):] + ', ' + prep
return title.strip()
coding = zip(

View File

@ -67,7 +67,9 @@ if pictureflow is not None:
return ans
def reset(self):
self.dataChanged.emit()
from PyQt4.Qt import SIGNAL ### TEMP
self.emit(SIGNAL('dataChanged()')) # TEMP
# self.dataChanged.emit()
def image(self, index):
return self.model.cover(index)