Verified Commit b5572156 authored by Luca Beltrame's avatar Luca Beltrame
Browse files

Port to QRandomGenerator from KRandom::random

KRandom::random() has been deprecated and AFAICS, the PIM CMake settings
disable deprecated API. This causes build failures.
parent 7d33df57
Pipeline #25405 passed with stage
in 18 minutes and 13 seconds
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <QDBusConnectionInterface> #include <QDBusConnectionInterface>
#include <QDBusServiceWatcher> #include <QDBusServiceWatcher>
#include <QPointer> #include <QPointer>
#include <QRandomGenerator>
#include <QRegularExpression> #include <QRegularExpression>
#include <QStringList> #include <QStringList>
...@@ -43,7 +44,6 @@ ...@@ -43,7 +44,6 @@
#include <KEMailSettings> #include <KEMailSettings>
#include <KLocalizedString> #include <KLocalizedString>
#include <KMessageBox> #include <KMessageBox>
#include <KRandom>
#include <Kdelibs4ConfigMigrator> #include <Kdelibs4ConfigMigrator>
#include <KWallet> #include <KWallet>
...@@ -547,7 +547,7 @@ int TransportManagerPrivate::createId() const ...@@ -547,7 +547,7 @@ int TransportManagerPrivate::createId() const
usedIds << 0; // 0 is default for unknown usedIds << 0; // 0 is default for unknown
int newId; int newId;
do { do {
newId = KRandom::random(); newId = QRandomGenerator::global()->generate();
} while (usedIds.contains(newId)); } while (usedIds.contains(newId));
return newId; return newId;
} }
......
Supports Markdown
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