mirror of
https://github.com/zealdocs/zeal.git
synced 2024-11-22 21:53:03 +03:00
fix(registry): use QRandomGenerator with Qt 5.10+
This commit is contained in:
parent
7fc6a1b046
commit
b7276001fe
@ -27,6 +27,9 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
||||
#include <QRandomGenerator>
|
||||
#endif
|
||||
#include <QVariant>
|
||||
#include <QXmlStreamReader>
|
||||
|
||||
@ -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<QUrl> DocsetMetadata::urls() const
|
||||
|
Loading…
Reference in New Issue
Block a user