summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-10-24 20:41:07 -0700
committerLars Knoll <lars.knoll@qt.io>2017-11-03 09:33:37 +0000
commit0cecbf084f805ddfd114370b2d8f5a107602971d (patch)
tree7b782b82fa9cf4bcf7122798ccebeb82696f3824
parentd340bf2be1738f3d47bc455ea122aef9a9e1c11d (diff)
downloadqtlocation-0cecbf084f805ddfd114370b2d8f5a107602971d.tar.gz
Update to new QRandomGenerator APIv5.10.0-beta4
Change-Id: I69f37f9304f24709a823fffd14e676c097712329 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/plugins/geoservices/nokia/qgeouriprovider.cpp2
-rw-r--r--src/plugins/position/android/src/jnipositioning.cpp4
-rw-r--r--tests/plugins/declarativetestplugin/qdeclarativelocationtestmodel.cpp6
3 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/geoservices/nokia/qgeouriprovider.cpp b/src/plugins/geoservices/nokia/qgeouriprovider.cpp
index f36a6694..b471f7c1 100644
--- a/src/plugins/geoservices/nokia/qgeouriprovider.cpp
+++ b/src/plugins/geoservices/nokia/qgeouriprovider.cpp
@@ -61,7 +61,7 @@ QGeoUriProvider::QGeoUriProvider(
QString QGeoUriProvider::getCurrentHost() const
{
if (m_maxSubdomains) {
- QString result(m_firstSubdomain.toLatin1() + QRandomGenerator::bounded(m_maxSubdomains));
+ QString result(m_firstSubdomain.toLatin1() + QRandomGenerator::global()->bounded(m_maxSubdomains));
result += '.' + m_currentHost;
return result;
}
diff --git a/src/plugins/position/android/src/jnipositioning.cpp b/src/plugins/position/android/src/jnipositioning.cpp
index e79e64d5..9bef8d36 100644
--- a/src/plugins/position/android/src/jnipositioning.cpp
+++ b/src/plugins/position/android/src/jnipositioning.cpp
@@ -109,7 +109,7 @@ namespace AndroidPositioning {
QGeoPositionInfoSourceAndroid *src = qobject_cast<QGeoPositionInfoSourceAndroid *>(obj);
Q_ASSERT(src);
do {
- key = QRandomGenerator::get32();
+ key = QRandomGenerator::global()->generate();
} while (idToPosSource()->contains(key));
idToPosSource()->insert(key, src);
@@ -117,7 +117,7 @@ namespace AndroidPositioning {
QGeoSatelliteInfoSourceAndroid *src = qobject_cast<QGeoSatelliteInfoSourceAndroid *>(obj);
Q_ASSERT(src);
do {
- key = QRandomGenerator::get32();
+ key = QRandomGenerator::global()->generate();
} while (idToSatSource()->contains(key));
idToSatSource()->insert(key, src);
diff --git a/tests/plugins/declarativetestplugin/qdeclarativelocationtestmodel.cpp b/tests/plugins/declarativetestplugin/qdeclarativelocationtestmodel.cpp
index e4bb755d..939225a7 100644
--- a/tests/plugins/declarativetestplugin/qdeclarativelocationtestmodel.cpp
+++ b/tests/plugins/declarativetestplugin/qdeclarativelocationtestmodel.cpp
@@ -61,7 +61,7 @@ void QDeclarativeLocationTestModel::timerFired()
repopulate();
if (crazyMode_) {
//qDebug() << "raw randomw value: " << qrand();
- int delay = (QRandomGenerator::bounded(uint(INT_MAX) + 1) % crazyLevel_); // writing software is exact science
+ int delay = (QRandomGenerator::global()->bounded(uint(INT_MAX) + 1) % crazyLevel_); // writing software is exact science
delay = qMax(1000, delay); // 3 ms at minimum
qDebug() << "starting timer with : " << delay;
timer_.start(delay);
@@ -162,7 +162,7 @@ void QDeclarativeLocationTestModel::repopulate()
}
int datacount = datacount_;
if (crazyMode_)
- datacount = QRandomGenerator::bounded(datacount_);
+ datacount = QRandomGenerator::global()->bounded(datacount_);
for (int i = 0; i < datacount; ++i) {
DataObject* dataobject = new DataObject;
@@ -204,7 +204,7 @@ void QDeclarativeLocationTestModel::scheduleRepopulation()
if (crazyMode_) {
// start generating arbitrary amount of data at arbitrary intervals
- int delay = QRandomGenerator::bounded(crazyLevel_); // writing software is exact science
+ int delay = QRandomGenerator::global()->bounded(crazyLevel_); // writing software is exact science
delay = qMax(3, delay); // 3 ms at minimum
qDebug() << "starting timer with : " << delay;
timer_.start(delay);