[wallpapers/image] Seed random number generator
ClosedPublic

Authored by davidedmundson on Oct 27 2019, 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
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 18231
Build 18249: arc lint + arc unit
davidedmundson created this revision.Oct 27 2019, 4:05 PM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 27 2019, 4:05 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.Oct 27 2019, 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.Oct 27 2019, 5:10 PM
This revision is now accepted and ready to land.Oct 27 2019, 5:10 PM
apol added a subscriber: apol.Oct 28 2019, 11:50 AM

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

davidre accepted this revision.Oct 29 2019, 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.