Skip to content

Commit 96bfa52

Browse files
authored
Use QDateTime::currentSecsSinceEpoch instead of QDateTime::currentDateTime().toSecsSinceEpoch() (#22920)
1 parent 893e220 commit 96bfa52

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void {{prefix}}HttpRequestInput::add_file(QString variable_name, QString local_f
4747

4848
{{prefix}}HttpRequestWorker::{{prefix}}HttpRequestWorker(QObject *parent, QNetworkAccessManager *_manager)
4949
: QObject(parent), manager(_manager), timeOutTimer(this), isResponseCompressionEnabled(false), isRequestCompressionEnabled(false), httpResponseCode(-1) {
50-
randomGenerator = QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch());
50+
randomGenerator = QRandomGenerator(QDateTime::currentSecsSinceEpoch());
5151
if (manager == nullptr) {
5252
manager = new QNetworkAccessManager(this);
5353
}
@@ -206,7 +206,7 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) {
206206
// variable layout is MULTIPART
207207
208208
boundary = QString("__-----------------------%1%2")
209-
.arg(QDateTime::currentDateTime().toSecsSinceEpoch())
209+
.arg(QDateTime::currentSecsSinceEpoch())
210210
.arg(randomGenerator.generate());
211211
QString boundary_delimiter = "--";
212212
QString new_line = "\r\n";

samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXHttpRequest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void PFXHttpRequestInput::add_file(QString variable_name, QString local_filename
5454

5555
PFXHttpRequestWorker::PFXHttpRequestWorker(QObject *parent, QNetworkAccessManager *_manager)
5656
: QObject(parent), manager(_manager), timeOutTimer(this), isResponseCompressionEnabled(false), isRequestCompressionEnabled(false), httpResponseCode(-1) {
57-
randomGenerator = QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch());
57+
randomGenerator = QRandomGenerator(QDateTime::currentSecsSinceEpoch());
5858
if (manager == nullptr) {
5959
manager = new QNetworkAccessManager(this);
6060
}
@@ -213,7 +213,7 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) {
213213
// variable layout is MULTIPART
214214

215215
boundary = QString("__-----------------------%1%2")
216-
.arg(QDateTime::currentDateTime().toSecsSinceEpoch())
216+
.arg(QDateTime::currentSecsSinceEpoch())
217217
.arg(randomGenerator.generate());
218218
QString boundary_delimiter = "--";
219219
QString new_line = "\r\n";

samples/client/petstore/cpp-qt/client/PFXHttpRequest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void PFXHttpRequestInput::add_file(QString variable_name, QString local_filename
5454

5555
PFXHttpRequestWorker::PFXHttpRequestWorker(QObject *parent, QNetworkAccessManager *_manager)
5656
: QObject(parent), manager(_manager), timeOutTimer(this), isResponseCompressionEnabled(false), isRequestCompressionEnabled(false), httpResponseCode(-1) {
57-
randomGenerator = QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch());
57+
randomGenerator = QRandomGenerator(QDateTime::currentSecsSinceEpoch());
5858
if (manager == nullptr) {
5959
manager = new QNetworkAccessManager(this);
6060
}
@@ -213,7 +213,7 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) {
213213
// variable layout is MULTIPART
214214

215215
boundary = QString("__-----------------------%1%2")
216-
.arg(QDateTime::currentDateTime().toSecsSinceEpoch())
216+
.arg(QDateTime::currentSecsSinceEpoch())
217217
.arg(randomGenerator.generate());
218218
QString boundary_delimiter = "--";
219219
QString new_line = "\r\n";

0 commit comments

Comments
 (0)