[wallpapers/image] Seed random number generator
ClosedPublic

Authored by davidedmundson on Sun, Oct 27, 4:05 PM.

Details

Summary

Otherwise when we randomise the wallpaper order we will always get the
same results.

CCBUG: 413463

Test Plan

qDebug + ran twice

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Sun, Oct 27, 4:05 PM
Restricted Application added a project: Plasma. · View Herald TranscriptSun, Oct 27, 4:05 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.Sun, Oct 27, 4:05 PM
anthonyfieroni added inline comments.
wallpapers/image/slidefiltermodel.cpp
140

random_shuffle is removed in C++17, so maybe we can change to
std::shuffle(m_randomOrder.begin(), m_randomOrder.end(), rand);

ngraham accepted this revision.Sun, Oct 27, 5:10 PM
This revision is now accepted and ready to land.Sun, Oct 27, 5:10 PM
apol added a subscriber: apol.Mon, Oct 28, 11:50 AM

Let's use KCoreAddons/KRandom?
These things don't happen there.

davidre accepted this revision.Tue, Oct 29, 6:03 PM
davidre added a subscriber: davidre.

I think this is fine. Imo we can address the comments on master

This revision was automatically updated to reflect the committed changes.

Landed this on the 5.17 branch just now to make sure it gets in for Plasma 5.17.2.