From 96b46984b39ec97906a69761cb9dea9f3a6a9b57 Mon Sep 17 00:00:00 2001 From: Sergey Chupligin Date: Fri, 22 Mar 2024 12:09:44 +0300 Subject: [PATCH] Fixup for Qt6 --- css/cssruleset.cpp | 2 +- html/htmldocument.cpp | 2 +- http/httprequest.cpp | 5 +++-- http/httpresource.cpp | 8 ++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/css/cssruleset.cpp b/css/cssruleset.cpp index 5a5c5e7..a60b8ad 100644 --- a/css/cssruleset.cpp +++ b/css/cssruleset.cpp @@ -86,7 +86,7 @@ void RuleSet::addDeclaration(QString property, } void RuleSet::addDeclarations(QString declarations) { - QStringList splitDeclarations = declarations.split(";", QString::SkipEmptyParts); + QStringList splitDeclarations = declarations.split(";", Qt::SkipEmptyParts); foreach(QString declaration, splitDeclarations) { if(declaration.contains(':')) { declaration = declaration.trimmed(); diff --git a/html/htmldocument.cpp b/html/htmldocument.cpp index 743d46c..d958024 100644 --- a/html/htmldocument.cpp +++ b/html/htmldocument.cpp @@ -140,7 +140,7 @@ QList Document::elementsByAttribute(QDomElement domElement, QString elementAttributeValue = domElement.attribute(attributeName, ""); if(allowMultipleValues) { - QStringList elementAttributeValues = elementAttributeValue.split("\\s+", QString::SkipEmptyParts); + QStringList elementAttributeValues = elementAttributeValue.split("\\s+", Qt::SkipEmptyParts); if(elementAttributeValues.contains(attributeValue)) { elementList.append(domElement); } diff --git a/http/httprequest.cpp b/http/httprequest.cpp index 30754f4..92b7863 100644 --- a/http/httprequest.cpp +++ b/http/httprequest.cpp @@ -27,6 +27,7 @@ // Qt includes #include +#include namespace QtWebServer { @@ -143,7 +144,7 @@ void Request::deserialize(QByteArray rawRequest) { // Read ahead the first line in the request QByteArray rawRequestLine = takeLine(rawRequest); QStringList requestLine = QString::fromUtf8(rawRequestLine) - .split(QRegExp("\\s+")); + .split(QRegularExpression("\\s+")); if(requestLine.count() < 3) { // The request line has to contain three strings: The method @@ -155,7 +156,7 @@ void Request::deserialize(QByteArray rawRequest) { _method = requestLine.at(0).toLower(); - QStringList splittedURI = requestLine.at(1).split('?', QString::SkipEmptyParts); + QStringList splittedURI = requestLine.at(1).split('?', Qt::SkipEmptyParts); if(splittedURI.count() > 1) { _urlParameters = Util::FormUrlCodec::decodeFormUrl(splittedURI.at(1).toUtf8()); } diff --git a/http/httpresource.cpp b/http/httpresource.cpp index ec889bb..dcfab4b 100644 --- a/http/httpresource.cpp +++ b/http/httpresource.cpp @@ -40,8 +40,8 @@ Resource::Resource(QString uniqueIdentifier, bool Resource::match(QString uniqueIdentifier) { // Split both the unique identifier of this resource the one in question, // so we can compare those. - QStringList splittedReferenceUri = this->uniqueIdentifier().split("/", QString::SkipEmptyParts); - QStringList splittedRequestedUri = uniqueIdentifier.split("/", QString::SkipEmptyParts); + QStringList splittedReferenceUri = this->uniqueIdentifier().split("/", Qt::SkipEmptyParts); + QStringList splittedRequestedUri = uniqueIdentifier.split("/", Qt::SkipEmptyParts); int count = splittedRequestedUri.count(); @@ -69,8 +69,8 @@ bool Resource::match(QString uniqueIdentifier) { QMap Resource::uriParameters(QString uniqueIdentifier) { // Split both the unique identifier of this resource the one in question, // so we can compare those. - QStringList splittedReferenceUri = this->uniqueIdentifier().split("/", QString::SkipEmptyParts); - QStringList splittedRequestedUri = uniqueIdentifier.split("/", QString::SkipEmptyParts); + QStringList splittedReferenceUri = this->uniqueIdentifier().split("/", Qt::SkipEmptyParts); + QStringList splittedRequestedUri = uniqueIdentifier.split("/", Qt::SkipEmptyParts); // Create a parameter map. QMap uriParameterMap;