Skip to content
Verified Commit 79f494d6 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
parent 6bd568c2
Pipeline #464189 passed with stage
in 8 minutes and 38 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