Browse Source

Use `std::pair` instead of `QPair`

PR #19548.
adaptive-webui-19844
Victor Chernyakin 1 year ago committed by GitHub
parent
commit
65930ddf94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/base/http/requestparser.cpp
  2. 1
      src/base/utils/net.cpp
  3. 3
      src/base/utils/net.h

3
src/base/http/requestparser.cpp

@ -31,6 +31,7 @@
#include "requestparser.h" #include "requestparser.h"
#include <algorithm> #include <algorithm>
#include <utility>
#include <QByteArrayView> #include <QByteArrayView>
#include <QDebug> #include <QDebug>
@ -45,7 +46,7 @@
using namespace Http; using namespace Http;
using namespace Utils::ByteArray; using namespace Utils::ByteArray;
using QStringPair = QPair<QString, QString>; using QStringPair = std::pair<QString, QString>;
namespace namespace
{ {

1
src/base/utils/net.cpp

@ -30,7 +30,6 @@
#include <QList> #include <QList>
#include <QNetworkInterface> #include <QNetworkInterface>
#include <QPair>
#include <QSslCertificate> #include <QSslCertificate>
#include <QSslKey> #include <QSslKey>
#include <QString> #include <QString>

3
src/base/utils/net.h

@ -29,6 +29,7 @@
#pragma once #pragma once
#include <optional> #include <optional>
#include <utility>
#include <QtContainerFwd> #include <QtContainerFwd>
#include <QHostAddress> #include <QHostAddress>
@ -40,7 +41,7 @@ class QString;
namespace Utils::Net namespace Utils::Net
{ {
// alias for `QHostAddress::parseSubnet()` return type // alias for `QHostAddress::parseSubnet()` return type
using Subnet = QPair<QHostAddress, int>; using Subnet = std::pair<QHostAddress, int>;
bool isValidIP(const QString &ip); bool isValidIP(const QString &ip);
std::optional<Subnet> parseSubnet(const QString &subnetStr); std::optional<Subnet> parseSubnet(const QString &subnetStr);

Loading…
Cancel
Save