diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache index b6469763e2b..e64476a579a 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache @@ -47,13 +47,7 @@ void {{prefix}}HttpRequestInput::add_file(QString variable_name, QString local_f {{prefix}}HttpRequestWorker::{{prefix}}HttpRequestWorker(QObject *parent, QNetworkAccessManager *_manager) : QObject(parent), manager(_manager), timeOutTimer(this), isResponseCompressionEnabled(false), isRequestCompressionEnabled(false), httpResponseCode(-1) { - -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) randomGenerator = QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch()); -#else - qsrand(QDateTime::currentDateTime().toTime_t()); -#endif - if (manager == nullptr) { manager = new QNetworkAccessManager(this); } @@ -212,13 +206,8 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { // variable layout is MULTIPART boundary = QString("__-----------------------%1%2") - #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) .arg(QDateTime::currentDateTime().toSecsSinceEpoch()) .arg(randomGenerator.generate()); - #else - .arg(QDateTime::currentDateTime().toTime_t()) - .arg(qrand()); - #endif QString boundary_delimiter = "--"; QString new_line = "\r\n"; @@ -359,16 +348,7 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { } else if (input->http_method == "DELETE") { reply = manager->deleteResource(request); } else { -#if (QT_VERSION >= 0x050800) reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), request_content); -#else - QBuffer *buffer = new QBuffer; - buffer->setData(request_content); - buffer->open(QIODevice::ReadOnly); - - reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), buffer); - buffer->setParent(reply); -#endif } if (reply != nullptr) { reply->setParent(this); diff --git a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXHttpRequest.cpp b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXHttpRequest.cpp index 4e36e7a596f..0e05affef6b 100644 --- a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXHttpRequest.cpp +++ b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXHttpRequest.cpp @@ -54,13 +54,7 @@ void PFXHttpRequestInput::add_file(QString variable_name, QString local_filename PFXHttpRequestWorker::PFXHttpRequestWorker(QObject *parent, QNetworkAccessManager *_manager) : QObject(parent), manager(_manager), timeOutTimer(this), isResponseCompressionEnabled(false), isRequestCompressionEnabled(false), httpResponseCode(-1) { - -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) randomGenerator = QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch()); -#else - qsrand(QDateTime::currentDateTime().toTime_t()); -#endif - if (manager == nullptr) { manager = new QNetworkAccessManager(this); } @@ -219,13 +213,8 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) { // variable layout is MULTIPART boundary = QString("__-----------------------%1%2") - #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) .arg(QDateTime::currentDateTime().toSecsSinceEpoch()) .arg(randomGenerator.generate()); - #else - .arg(QDateTime::currentDateTime().toTime_t()) - .arg(qrand()); - #endif QString boundary_delimiter = "--"; QString new_line = "\r\n"; @@ -366,16 +355,7 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) { } else if (input->http_method == "DELETE") { reply = manager->deleteResource(request); } else { -#if (QT_VERSION >= 0x050800) reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), request_content); -#else - QBuffer *buffer = new QBuffer; - buffer->setData(request_content); - buffer->open(QIODevice::ReadOnly); - - reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), buffer); - buffer->setParent(reply); -#endif } if (reply != nullptr) { reply->setParent(this); diff --git a/samples/client/petstore/cpp-qt/client/PFXHttpRequest.cpp b/samples/client/petstore/cpp-qt/client/PFXHttpRequest.cpp index 4e36e7a596f..0e05affef6b 100644 --- a/samples/client/petstore/cpp-qt/client/PFXHttpRequest.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXHttpRequest.cpp @@ -54,13 +54,7 @@ void PFXHttpRequestInput::add_file(QString variable_name, QString local_filename PFXHttpRequestWorker::PFXHttpRequestWorker(QObject *parent, QNetworkAccessManager *_manager) : QObject(parent), manager(_manager), timeOutTimer(this), isResponseCompressionEnabled(false), isRequestCompressionEnabled(false), httpResponseCode(-1) { - -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) randomGenerator = QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch()); -#else - qsrand(QDateTime::currentDateTime().toTime_t()); -#endif - if (manager == nullptr) { manager = new QNetworkAccessManager(this); } @@ -219,13 +213,8 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) { // variable layout is MULTIPART boundary = QString("__-----------------------%1%2") - #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) .arg(QDateTime::currentDateTime().toSecsSinceEpoch()) .arg(randomGenerator.generate()); - #else - .arg(QDateTime::currentDateTime().toTime_t()) - .arg(qrand()); - #endif QString boundary_delimiter = "--"; QString new_line = "\r\n"; @@ -366,16 +355,7 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) { } else if (input->http_method == "DELETE") { reply = manager->deleteResource(request); } else { -#if (QT_VERSION >= 0x050800) reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), request_content); -#else - QBuffer *buffer = new QBuffer; - buffer->setData(request_content); - buffer->open(QIODevice::ReadOnly); - - reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), buffer); - buffer->setParent(reply); -#endif } if (reply != nullptr) { reply->setParent(this);