From 7f080d08252dfb699d4e3ae072cc3db0d2de129d Mon Sep 17 00:00:00 2001 From: melvo Date: Sun, 29 Mar 2020 22:15:52 +0200 Subject: Replace deprecated 'qsrand()' and 'qrand()' by QRandomGenerator (#267) Since QRandomGenerator is only available since Qt 5.10, the deprecated functions are still used for Qt < 5.10. --- src/base/QXmppStream.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/base/QXmppStream.cpp') diff --git a/src/base/QXmppStream.cpp b/src/base/QXmppStream.cpp index 1d81dbdb..dac3a02a 100644 --- a/src/base/QXmppStream.cpp +++ b/src/base/QXmppStream.cpp @@ -40,7 +40,9 @@ #include #include +#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) static bool randomSeeded = false; +#endif static const QByteArray streamRootElementEnd = QByteArrayLiteral(""); class QXmppStreamPrivate @@ -74,11 +76,13 @@ QXmppStream::QXmppStream(QObject *parent) : QXmppLoggable(parent), d(new QXmppStreamPrivate) { +#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) // Make sure the random number generator is seeded if (!randomSeeded) { qsrand(QTime(0, 0, 0).msecsTo(QTime::currentTime()) ^ reinterpret_cast(this)); randomSeeded = true; } +#endif } /// -- cgit v1.2.3