Showing the changes to interface/src/scripting/GooglePolyScriptingInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -22,6 +22,7 @@ · 21 unmodified lines | |||
| 22 | #include <QString> | 22 | #include <QString> |
| 23 | #include <QTime> | 23 | #include <QTime> |
| 24 | #include <QUrl> | 24 | #include <QUrl> |
| 25 | #include <QRandomGenerator> | ||
| 25 | 26 | ||
| 26 | #include "ScriptEngineLogging.h" | 27 | #include "ScriptEngineLogging.h" |
| 27 | 28 | ||
| @@ -102,9 +103,7 @@ QString GooglePolyScriptingInterface::getModelInfo(const QString& input) { · 74 unmodified lines | |||
| 102 | } | 103 | } |
| 103 | 104 | ||
| 104 | int GooglePolyScriptingInterface::getRandIntInRange(int length) { | 105 | int GooglePolyScriptingInterface::getRandIntInRange(int length) { |
| 105 | QTime time = QTime::currentTime(); | 106 | return QRandomGenerator::global()->bounded(length); |
| 106 | qsrand((uint)time.msec()); | ||
| 107 | return qrand() % length; | ||
| 108 | } | 107 | } |
| 109 | 108 | ||
| 110 | QUrl GooglePolyScriptingInterface::formatURLQuery(const QString& keyword, const QString& category, const QString& format) { | 109 | QUrl GooglePolyScriptingInterface::formatURLQuery(const QString& keyword, const QString& category, const QString& format) { |