resort maximum_resort_levels tweak implemented

This commit is contained in:
Charles Haley 2010-09-11 21:01:26 +01:00
parent 64f881f3a6
commit 6eaa75527b
2 changed files with 9 additions and 2 deletions

View File

@ -114,3 +114,10 @@ add_new_book_tags_when_importing_books = False
# Set the maximum number of tags to show per book in the content server
max_content_server_tags_shown=5
# Set the maximum number of sort 'levels' that calibre will use to resort the
# library after certain operations such as searches or device insertion. Each
# sort level adds a performance penalty. If the database is large (thousands of
# books) the penalty might be noticeable. If you are not concerned about multi-
# level sorts, and if you are seeing a slowdown, reduce the value of this tweak.
maximum_resort_levels = 5

View File

@ -266,8 +266,8 @@ class BooksModel(QAbstractTableModel): # {{{
self.db.refresh(field=None)
self.resort(reset=reset)
def resort(self, reset=True, history=5): # Bug report needed history=4 :)
for col,ord in reversed(self.sort_history[:history]):
def resort(self, reset=True):
for col,ord in reversed(self.sort_history[:tweaks['maximum_resort_levels']]):
try:
col = self.column_map.index(col)
except ValueError: