Skip to content

wallpapers/image: fix random order update logic

Fushan Wen requested to merge work/fuf/473088 into master

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

Edited by Fushan Wen

Merge request reports