Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup for Qt6 #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion css/cssruleset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion html/htmldocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ QList<QDomElement> 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);
}
Expand Down
5 changes: 3 additions & 2 deletions http/httprequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

// Qt includes
#include <QStringList>
#include <QRegularExpression>

namespace QtWebServer {

Expand Down Expand Up @@ -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
Expand All @@ -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());
}
Expand Down
8 changes: 4 additions & 4 deletions http/httpresource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -69,8 +69,8 @@ bool Resource::match(QString uniqueIdentifier) {
QMap<QString, QString> 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<QString, QString> uriParameterMap;
Expand Down