From 839679e4ec9667b2c36daab1fe0d499673228d50 Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Thu, 1 Oct 2020 19:02:26 +0300 Subject: Replace obsolete qrand() with QRandomGenerator Change-Id: Ie61b192bcf047cc70f728ea15370ff50e7a41769 Reviewed-by: Iikka Eklund --- src/libs/installer/fileutils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libs/installer/fileutils.cpp') diff --git a/src/libs/installer/fileutils.cpp b/src/libs/installer/fileutils.cpp index 61891832e..76e5e3cd8 100644 --- a/src/libs/installer/fileutils.cpp +++ b/src/libs/installer/fileutils.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -460,9 +461,8 @@ QString QInstaller::generateTemporaryFileName(const QString &templ) static const QString characters = QLatin1String("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"); QString suffix; - qsrand(qrand() * QDateTime::currentDateTime().toTime_t()); for (int i = 0; i < 5; ++i) - suffix += characters[qrand() % characters.length()]; + suffix += characters[QRandomGenerator::global()->generate() % characters.length()]; const QString tmp = QLatin1String("%1.tmp.%2.%3"); int count = 1; -- cgit v1.2.3