mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 09:50:12 +00:00
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.
This commit is contained in:
parent
caa639fb44
commit
cdb4a7909d
|
@ -1405,10 +1405,19 @@ QList<int> KFileItemModelRolesUpdater::indexesToResolve() const
|
||||||
(2 * m_maximumVisibleItems)));
|
(2 * m_maximumVisibleItems)));
|
||||||
|
|
||||||
// Add visible items.
|
// Add visible items.
|
||||||
|
// Resolve files first, their previews are quicker.
|
||||||
|
QList<int> visibleDirs;
|
||||||
for (int i = m_firstVisibleIndex; i <= m_lastVisibleIndex; ++i) {
|
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
|
// We need a reasonable upper limit for number of items to resolve after
|
||||||
// and before the visible range. m_maximumVisibleItems can be quite large
|
// and before the visible range. m_maximumVisibleItems can be quite large
|
||||||
// when using Compact View.
|
// when using Compact View.
|
||||||
|
|
Loading…
Reference in a new issue