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:
Kovid Goyal 2013-09-02 09:32:27 +05:30
parent 9d848e14a7
commit 528a1617de

View file

@ -10,7 +10,7 @@
from types import MethodType
from time import time
from threading import Event, Thread
from Queue import Queue
from Queue import LifoQueue
from functools import wraps, partial
from textwrap import wrap
@ -313,7 +313,7 @@ def __init__(self, parent):
self.animation.setDuration(500)
self.set_dimensions()
self.cover_cache = CoverCache(limit=gprefs['cover_grid_cache_size'])
self.render_queue = Queue()
self.render_queue = LifoQueue()
self.animating = None
self.highlight_color = QColor(Qt.white)