Skip to content

Commit 8849156

Browse files
m33rc47Daniel Simon
and
Daniel Simon
authored
Remove further Qt support before Qt 5.15.2 (#19824)
* Remove further Qt support before Qt 5.15.2 This is a follow-up pull request for [#19164] (#19164), which removes the further handling of older Qt versions. * Updates samples to match the mustach config files. --------- Co-authored-by: Daniel Simon <[email protected]>
1 parent 2838b95 commit 8849156

File tree

3 files changed

+0
-60
lines changed

3 files changed

+0
-60
lines changed

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

-20
Original file line numberDiff line numberDiff line change
@@ -47,13 +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-
51-
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
5250
randomGenerator = QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch());
53-
#else
54-
qsrand(QDateTime::currentDateTime().toTime_t());
55-
#endif
56-
5751
if (manager == nullptr) {
5852
manager = new QNetworkAccessManager(this);
5953
}
@@ -212,13 +206,8 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) {
212206
// variable layout is MULTIPART
213207
214208
boundary = QString("__-----------------------%1%2")
215-
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
216209
.arg(QDateTime::currentDateTime().toSecsSinceEpoch())
217210
.arg(randomGenerator.generate());
218-
#else
219-
.arg(QDateTime::currentDateTime().toTime_t())
220-
.arg(qrand());
221-
#endif
222211
QString boundary_delimiter = "--";
223212
QString new_line = "\r\n";
224213
@@ -359,16 +348,7 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) {
359348
} else if (input->http_method == "DELETE") {
360349
reply = manager->deleteResource(request);
361350
} else {
362-
#if (QT_VERSION >= 0x050800)
363351
reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), request_content);
364-
#else
365-
QBuffer *buffer = new QBuffer;
366-
buffer->setData(request_content);
367-
buffer->open(QIODevice::ReadOnly);
368-
369-
reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), buffer);
370-
buffer->setParent(reply);
371-
#endif
372352
}
373353
if (reply != nullptr) {
374354
reply->setParent(this);

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

-20
Original file line numberDiff line numberDiff line change
@@ -54,13 +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-
58-
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
5957
randomGenerator = QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch());
60-
#else
61-
qsrand(QDateTime::currentDateTime().toTime_t());
62-
#endif
63-
6458
if (manager == nullptr) {
6559
manager = new QNetworkAccessManager(this);
6660
}
@@ -219,13 +213,8 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) {
219213
// variable layout is MULTIPART
220214

221215
boundary = QString("__-----------------------%1%2")
222-
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
223216
.arg(QDateTime::currentDateTime().toSecsSinceEpoch())
224217
.arg(randomGenerator.generate());
225-
#else
226-
.arg(QDateTime::currentDateTime().toTime_t())
227-
.arg(qrand());
228-
#endif
229218
QString boundary_delimiter = "--";
230219
QString new_line = "\r\n";
231220

@@ -366,16 +355,7 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) {
366355
} else if (input->http_method == "DELETE") {
367356
reply = manager->deleteResource(request);
368357
} else {
369-
#if (QT_VERSION >= 0x050800)
370358
reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), request_content);
371-
#else
372-
QBuffer *buffer = new QBuffer;
373-
buffer->setData(request_content);
374-
buffer->open(QIODevice::ReadOnly);
375-
376-
reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), buffer);
377-
buffer->setParent(reply);
378-
#endif
379359
}
380360
if (reply != nullptr) {
381361
reply->setParent(this);

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

-20
Original file line numberDiff line numberDiff line change
@@ -54,13 +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-
58-
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
5957
randomGenerator = QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch());
60-
#else
61-
qsrand(QDateTime::currentDateTime().toTime_t());
62-
#endif
63-
6458
if (manager == nullptr) {
6559
manager = new QNetworkAccessManager(this);
6660
}
@@ -219,13 +213,8 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) {
219213
// variable layout is MULTIPART
220214

221215
boundary = QString("__-----------------------%1%2")
222-
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
223216
.arg(QDateTime::currentDateTime().toSecsSinceEpoch())
224217
.arg(randomGenerator.generate());
225-
#else
226-
.arg(QDateTime::currentDateTime().toTime_t())
227-
.arg(qrand());
228-
#endif
229218
QString boundary_delimiter = "--";
230219
QString new_line = "\r\n";
231220

@@ -366,16 +355,7 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) {
366355
} else if (input->http_method == "DELETE") {
367356
reply = manager->deleteResource(request);
368357
} else {
369-
#if (QT_VERSION >= 0x050800)
370358
reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), request_content);
371-
#else
372-
QBuffer *buffer = new QBuffer;
373-
buffer->setData(request_content);
374-
buffer->open(QIODevice::ReadOnly);
375-
376-
reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), buffer);
377-
buffer->setParent(reply);
378-
#endif
379359
}
380360
if (reply != nullptr) {
381361
reply->setParent(this);

0 commit comments

Comments
 (0)