Skip to content

馃崚wallpapers/image: fix random order update logic

Fushan Wen requested to merge work/fuf/cp into Plasma/5.27

In SlideFilterModel, an added/deleted wallpaper is not always the last one, so first and last also needs to be taken into account.

m_randomOrder stores the row numbers of the source model in a specific order. When a new wallpaper is added, the first argument is not always equal to sourceModel->rowCount(), and when the condition is not met, all the existing row numbers in m_randomOrder that >= first need to be increased by 1 (or the number of new wallpapers), to make space for new wallpapers. Vice versa when wallpapers are removed.

CCBUG: 473088 (cherry picked from commit 79f494d6)

Merge request reports

Loading