Replace deprecated QDateTime toTime_t by toSecsSinceEpoch

pull/1434/head
Jiří Pinkava 2022-09-21 21:41:40 +02:00
rodzic fcbaaf7100
commit 996134d898
3 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -60,7 +60,7 @@ uint32_t RTPRandom::PickSeed()
x = (uint32_t) getpid();
#endif
QDateTime currentDateTime = QDateTime::currentDateTime();
x += currentDateTime.toTime_t();
x += currentDateTime.toSecsSinceEpoch();
#if defined(WIN32)
x += QDateTime::currentMSecsSinceEpoch() % 1000;
#else

Wyświetl plik

@ -35,7 +35,7 @@
uint64_t UidCalculator::getNewObjectId()
{
QDateTime currentDateTime = QDateTime::currentDateTime();
uint64_t uid = currentDateTime.toTime_t();
uint64_t uid = currentDateTime.toSecsSinceEpoch();
uid *= 1000000UL; // make room for microseconds
// Fallback to milliseconds:

Wyświetl plik

@ -54,7 +54,7 @@ void SWGHttpRequestInput::add_file(QString variable_name, QString local_filename
SWGHttpRequestWorker::SWGHttpRequestWorker(QObject *parent)
: QObject(parent), manager(nullptr)
{
QRandomGenerator::global()->seed(QDateTime::currentDateTime().toTime_t());
QRandomGenerator::global()->seed(QDateTime::currentDateTime().toSecsSinceEpoch());
manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(on_manager_finished(QNetworkReply*)));
@ -163,7 +163,7 @@ void SWGHttpRequestWorker::execute(SWGHttpRequestInput *input) {
// variable layout is MULTIPART
boundary = "__-----------------------"
+ QString::number(QDateTime::currentDateTime().toTime_t())
+ QString::number(QDateTime::currentDateTime().toSecsSinceEpoch())
+ QString::number(QRandomGenerator::global()->generate());
QString boundary_delimiter = "--";
QString new_line = "\r\n";