From b7276001feb4603e96a15fa62b2b00ad662d2921 Mon Sep 17 00:00:00 2001 From: Oleg Shparber Date: Sun, 14 Jun 2020 14:01:10 -0400 Subject: [PATCH] fix(registry): use QRandomGenerator with Qt 5.10+ --- src/libs/registry/docsetmetadata.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libs/registry/docsetmetadata.cpp b/src/libs/registry/docsetmetadata.cpp index e1b2b68..2f9988e 100644 --- a/src/libs/registry/docsetmetadata.cpp +++ b/src/libs/registry/docsetmetadata.cpp @@ -27,6 +27,9 @@ #include #include #include +#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) +#include +#endif #include #include @@ -164,7 +167,11 @@ QUrl DocsetMetadata::feedUrl() const QUrl DocsetMetadata::url() const { +#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) + return m_urls.at(QRandomGenerator::global()->bounded(m_urls.size())); +#else return m_urls.at(qrand() % m_urls.size()); +#endif } QList DocsetMetadata::urls() const