mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
[KFileItemModelRolesUpdater] Avoid duplicate indexes to resolve
This avoids requesting a thumbnail twice for certain files, typically the first or last one in a folder. Differential Revision: https://phabricator.kde.org/D15404
This commit is contained in:
parent
92a4b5bb62
commit
033eb6b3a3
|
@ -1165,14 +1165,18 @@ QList<int> KFileItemModelRolesUpdater::indexesToResolve() const
|
|||
|
||||
// Add items on the last page.
|
||||
const int beginLastPage = qMax(qMin(endExtendedVisibleRange + 1, count - 1), count - m_maximumVisibleItems);
|
||||
for (int i = beginLastPage; i < count; ++i) {
|
||||
result.append(i);
|
||||
if (beginLastPage < count - 1) {
|
||||
for (int i = beginLastPage; i < count; ++i) {
|
||||
result.append(i);
|
||||
}
|
||||
}
|
||||
|
||||
// Add items on the first page.
|
||||
const int endFirstPage = qMin(qMax(beginExtendedVisibleRange - 1, 0), m_maximumVisibleItems);
|
||||
for (int i = 0; i <= endFirstPage; ++i) {
|
||||
result.append(i);
|
||||
if (beginExtendedVisibleRange > 0) {
|
||||
for (int i = 0; i <= endFirstPage; ++i) {
|
||||
result.append(i);
|
||||
}
|
||||
}
|
||||
|
||||
// Continue adding items until ResolveAllItemsLimit is reached.
|
||||
|
|
Loading…
Reference in a new issue