Commit 53b679ca authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Port away from KRandomSequence

GIT_SILENCE
parent 33e31e3b
......@@ -44,7 +44,7 @@ KCompactDiscPrivate::KCompactDiscPrivate(KCompactDisc *p, const QString& dev) :
m_trackExpectedPosition(0),
m_seek(0),
m_randSequence(0),
m_randSequence(QRandomGenerator::global()->generate()),
m_loopPlaylist(false),
m_randomPlaylist(false),
m_autoMetadata(true),
......@@ -119,7 +119,7 @@ void KCompactDiscPrivate::make_playlist()
for(unsigned i = 0; i < size; ++i) {
if(m_randomPlaylist) {
do {
selected = 1 + m_randSequence.getLong(size);
selected = 1 + m_randSequence.bounded(size);
rejected = (m_playlist.indexOf(selected) != -1);
} while(rejected == true);
} else {
......
......@@ -25,8 +25,8 @@
#include <QList>
#include <QLoggingCategory>
#include <QtGlobal>
#include <QRandomGenerator>
#include <krandomsequence.h>
#include "kcompactdisc.h"
Q_DECLARE_LOGGING_CATEGORY(CD_PLAYLIST)
......@@ -61,7 +61,7 @@ class KCompactDiscPrivate : public QObject
QStringList m_trackArtists;
QStringList m_trackTitles;
KRandomSequence m_randSequence;
QRandomGenerator m_randSequence;
QList<unsigned> m_playlist;
bool m_loopPlaylist;
bool m_randomPlaylist;
......
Markdown is supported
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