Commit cdb4a790 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

KFileItemModelRolesUpdater: Generate thumbnails for visible files first

Folder thumbnails are not cached as we cannot know whether something
inside a folder changed. Moreover, they are also a collage of several
files and might even traverse into subdirectories. This takes time.
parent caa639fb
Pipeline #100558 passed with stage
in 5 minutes and 13 seconds
......@@ -1405,10 +1405,19 @@ QList<int> KFileItemModelRolesUpdater::indexesToResolve() const
(2 * m_maximumVisibleItems)));
// Add visible items.
// Resolve files first, their previews are quicker.
QList<int> visibleDirs;
for (int i = m_firstVisibleIndex; i <= m_lastVisibleIndex; ++i) {
result.append(i);
const KFileItem item = m_model->fileItem(i);
if (item.isDir()) {
visibleDirs.append(i);
} else {
result.append(i);
}
}
result.append(visibleDirs);
// We need a reasonable upper limit for number of items to resolve after
// and before the visible range. m_maximumVisibleItems can be quite large
// when using Compact View.
......
Markdown is supported
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