aboutsummaryrefslogtreecommitdiff
path: root/src/base/QXmppStream.cpp
diff options
context:
space:
mode:
authormelvo <melvo@olomono.de>2020-03-29 22:15:52 +0200
committerGitHub <noreply@github.com>2020-03-29 22:15:52 +0200
commit7f080d08252dfb699d4e3ae072cc3db0d2de129d (patch)
treeb20dfe59b2e0730ffdaeaf53f129585393802a90 /src/base/QXmppStream.cpp
parent13870274bba1765a1fcecedb5bcc0eda8db682eb (diff)
downloadqxmpp-7f080d08252dfb699d4e3ae072cc3db0d2de129d.tar.gz
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.
Diffstat (limited to 'src/base/QXmppStream.cpp')
-rw-r--r--src/base/QXmppStream.cpp4
1 files changed, 4 insertions, 0 deletions
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 <QTime>
#include <QXmlStreamWriter>
+#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
static bool randomSeeded = false;
+#endif
static const QByteArray streamRootElementEnd = QByteArrayLiteral("</stream:stream>");
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<quintptr>(this));
randomSeeded = true;
}
+#endif
}
///