mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Change thumbnail cache to use a LIFO queue
This should fix the problem of covers being rendered slowly at the end when scrolling through a very large number of covers very quickly.
This commit is contained in:
parent
9d848e14a7
commit
528a1617de
@ -10,7 +10,7 @@ import itertools, operator, os
|
|||||||
from types import MethodType
|
from types import MethodType
|
||||||
from time import time
|
from time import time
|
||||||
from threading import Event, Thread
|
from threading import Event, Thread
|
||||||
from Queue import Queue
|
from Queue import LifoQueue
|
||||||
from functools import wraps, partial
|
from functools import wraps, partial
|
||||||
from textwrap import wrap
|
from textwrap import wrap
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ class CoverDelegate(QStyledItemDelegate):
|
|||||||
self.animation.setDuration(500)
|
self.animation.setDuration(500)
|
||||||
self.set_dimensions()
|
self.set_dimensions()
|
||||||
self.cover_cache = CoverCache(limit=gprefs['cover_grid_cache_size'])
|
self.cover_cache = CoverCache(limit=gprefs['cover_grid_cache_size'])
|
||||||
self.render_queue = Queue()
|
self.render_queue = LifoQueue()
|
||||||
self.animating = None
|
self.animating = None
|
||||||
self.highlight_color = QColor(Qt.white)
|
self.highlight_color = QColor(Qt.white)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user