mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Title sort tweak.
This commit is contained in:
parent
d2677fc1bb
commit
fe1316f201
@ -61,3 +61,13 @@ sort_columns_at_startup = None
|
|||||||
# default if not set: MMM yyyy
|
# default if not set: MMM yyyy
|
||||||
gui_pubdate_display_format = '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'
|
||||||
|
@ -43,10 +43,11 @@ def authors_to_sort_string(authors):
|
|||||||
|
|
||||||
_title_pat = re.compile('^(A|The|An)\s+', re.IGNORECASE)
|
_title_pat = re.compile('^(A|The|An)\s+', re.IGNORECASE)
|
||||||
def title_sort(title):
|
def title_sort(title):
|
||||||
match = _title_pat.search(title)
|
if tweaks['title_sorting'] == 'library_order':
|
||||||
if match:
|
match = _title_pat.search(title)
|
||||||
prep = match.group(1)
|
if match:
|
||||||
title = title[len(prep):] + ', ' + prep
|
prep = match.group(1)
|
||||||
|
title = title[len(prep):] + ', ' + prep
|
||||||
return title.strip()
|
return title.strip()
|
||||||
|
|
||||||
coding = zip(
|
coding = zip(
|
||||||
|
@ -67,7 +67,9 @@ if pictureflow is not None:
|
|||||||
return ans
|
return ans
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
self.dataChanged.emit()
|
from PyQt4.Qt import SIGNAL ### TEMP
|
||||||
|
self.emit(SIGNAL('dataChanged()')) # TEMP
|
||||||
|
# self.dataChanged.emit()
|
||||||
|
|
||||||
def image(self, index):
|
def image(self, index):
|
||||||
return self.model.cover(index)
|
return self.model.cover(index)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user