1/*
2 SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org>
3 SPDX-FileCopyrightText: 2013 Daniel Nicoletti <dantti12@gmail.com>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#include "ipaddress.h"
9
10namespace NetworkManager
11{
12class IpAddress::Private
13{
14public:
15 QHostAddress gateway;
16};
17
18}
19
20NetworkManager::IpAddress::IpAddress()
21 : d(new Private)
22{
23}
24
25NetworkManager::IpAddress::~IpAddress()
26{
27 delete d;
28}
29
30NetworkManager::IpAddress::IpAddress(const NetworkManager::IpAddress &other)
31 : QNetworkAddressEntry(other)
32 , d(new Private)
33{
34 *this = other;
35}
36
37bool NetworkManager::IpAddress::isValid() const
38{
39 return !ip().isNull();
40}
41
42void NetworkManager::IpAddress::setGateway(const QHostAddress &gateway)
43{
44 d->gateway = gateway;
45}
46
47QHostAddress NetworkManager::IpAddress::gateway() const
48{
49 return d->gateway;
50}
51
52NetworkManager::IpAddress &NetworkManager::IpAddress::operator=(const NetworkManager::IpAddress &other)
53{
54 if (this == &other) {
55 return *this;
56 }
57
58 QNetworkAddressEntry::operator=(other);
59 *d = *other.d;
60
61 return *this;
62}
63

source code of networkmanager-qt/src/ipaddress.cpp