Commit 78151490 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to QRandomGenerator

parent 89af8664
......@@ -32,6 +32,7 @@
#include <QShortcut>
#include <QStatusBar>
#include <QWindowStateChangeEvent>
#include <QRandomGenerator>
// KDE
#include <KActionCollection>
......@@ -420,7 +421,7 @@ void KMahjongg::startNewGame(int item)
availableLayouts.append(dir + '/' + file);
}
}
const QString layout = availableLayouts.at(qrand() % availableLayouts.size());
const QString layout = availableLayouts.at(QRandomGenerator::global()->bounded(availableLayouts.size()));
if (m_boardLayout->path() != layout) {
// Try to load the random layout.
......
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