From 72a05e138ec579cd567939eb0b33b0ea476820fb Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 20 Jun 2022 16:25:54 +0200 Subject: Fix deprecation warnings where possible, make remaining ones -Wno-error --- src/copythread.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/copythread.cpp') diff --git a/src/copythread.cpp b/src/copythread.cpp index 5b9710b..34d89f4 100644 --- a/src/copythread.cpp +++ b/src/copythread.cpp @@ -3,13 +3,14 @@ #include #include #include +#include // 1M read size #define BUFFER_SIZE (1000000) // 20 seconds for each test #define TEST_LENGTH (60000) -#define BIGRAND (qint64(qrand()) | (qint64(qrand()) * qint64(RAND_MAX))) +#define BIGRAND (QRandomGenerator::global()->generate64()) CopyThread::CopyThread(QFile *file, QObject *parent) : QThread(parent), @@ -40,7 +41,7 @@ void CopyThread::run() const qint64 size = _file->size() - BUFFER_SIZE; // Sequential read - emit logMessage(trUtf8("Starting sequential read test")); + emit logMessage(tr("Starting sequential read test")); if (size > 0) { _file->seek(BIGRAND % size); } @@ -56,7 +57,7 @@ void CopyThread::run() // Random read if (size > 0) { - emit logMessage(trUtf8("Starting random read test")); + emit logMessage(tr("Starting random read test")); timer.restart(); do { _file->seek(BIGRAND % size); @@ -69,7 +70,7 @@ void CopyThread::run() // All done const qint64 seqSpeed = seqSum / (seqTime * 1024 + 1); const qint64 rndSpeed = rndSum / (rndTime * 1024 + 1); - emit logMessage(trUtf8("Seq: %1MiB/s, Random: %2MiB/s - [%3s / %4s]") + emit logMessage(tr("Seq: %1MiB/s, Random: %2MiB/s - [%3s / %4s]") .arg(QString::number(seqSpeed), QString::number(rndSpeed), QString::number(seqTime / 1000), QString::number(rndTime / 1000))); delete[] buffer; -- cgit v1.2.3-55-g7522