Unverified Commit 829c0ed1 authored by Yue-Lan's avatar Yue-Lan
Browse files

refactor the thumbnail frameworks to resolve memory problem.

for old frameworks, the thumbnail is actually a whole image, and thumbnailing thread can not be cancel.
so that it has serious flaws in memory usage.

first what i do is to let the image scaled into a smaller size if it is too big. it will ensure that
when all thumbnail job finished, the memory usage will not become so scaring.

second i do is to use a thumbnail job bounded with a directory item parent, when item deleted it should
not do a thumbnail. it will actually limit the Instantaneous peak of memory usage.

the main idea is:
1. replace QtConcurrent::run() with a QRunnable, limit thread count with QThreadPool instance.
2. use QObject parent mechanism control the job's running.
parent babd67d7
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment