Skip to content
Verified Commit f26f7b1a authored by Fushan Wen's avatar Fushan Wen
Browse files

wallpapers/image: fix random order update logic

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)
parent b027e209
Pipeline #464274 passed with stage
in 5 minutes and 31 seconds
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