diff --git a/package/archlinux/PKGBUILD b/package/archlinux/PKGBUILD index 73dfb4343..8d671d2cd 100644 --- a/package/archlinux/PKGBUILD +++ b/package/archlinux/PKGBUILD @@ -3,7 +3,7 @@ # https://wiki.archlinux.org/index.php/Arch_package_guidelines pkgname=katie-git -pkgver=4.14.0.r8194.64a1e01ca +pkgver=4.14.0.r8207.bd53fa415 pkgrel=1 pkgdesc='C++ toolkit derived from the Qt 4.8 framework' arch=('i486' 'i686' 'pentium4' 'x86_64' 'arm') diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp index 8aa5f1f8f..999a44742 100644 --- a/src/network/kernel/qnetworkinterface.cpp +++ b/src/network/kernel/qnetworkinterface.cpp @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE Constructs an empty QNetworkAddressEntry object. */ QNetworkAddressEntry::QNetworkAddressEntry() - : d(new QNetworkAddressEntryPrivate) + : d(new QNetworkAddressEntryPrivate()) { } @@ -60,8 +60,11 @@ QNetworkAddressEntry::QNetworkAddressEntry() object \a other. */ QNetworkAddressEntry::QNetworkAddressEntry(const QNetworkAddressEntry &other) - : d(new QNetworkAddressEntryPrivate(*other.d.data())) + : d(new QNetworkAddressEntryPrivate()) { + d->address = other.d->address; + d->netmask = other.d->netmask; + d->broadcast = other.d->broadcast; } /*! @@ -69,7 +72,9 @@ QNetworkAddressEntry::QNetworkAddressEntry(const QNetworkAddressEntry &other) */ QNetworkAddressEntry &QNetworkAddressEntry::operator=(const QNetworkAddressEntry &other) { - *d.data() = *other.d.data(); + d->address = other.d->address; + d->netmask = other.d->netmask; + d->broadcast = other.d->broadcast; return *this; } @@ -78,6 +83,7 @@ QNetworkAddressEntry &QNetworkAddressEntry::operator=(const QNetworkAddressEntry */ QNetworkAddressEntry::~QNetworkAddressEntry() { + delete d; } /*! @@ -86,11 +92,11 @@ QNetworkAddressEntry::~QNetworkAddressEntry() */ bool QNetworkAddressEntry::operator==(const QNetworkAddressEntry &other) const { - if (d == other.d) return true; - if (!d || !other.d) return false; - return d->address == other.d->address && + return ( + d->address == other.d->address && d->netmask == other.d->netmask && - d->broadcast == other.d->broadcast; + d->broadcast == other.d->broadcast + ); } /*! diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h index c02acafbc..7d23aae58 100644 --- a/src/network/kernel/qnetworkinterface.h +++ b/src/network/kernel/qnetworkinterface.h @@ -22,16 +22,14 @@ #ifndef QNETWORKINTERFACE_H #define QNETWORKINTERFACE_H +#include #include -#include #include #ifndef QT_NO_NETWORKINTERFACE QT_BEGIN_NAMESPACE -template class QList; - class QNetworkAddressEntryPrivate; class QNetworkInterfacePrivate; @@ -42,6 +40,7 @@ public: QNetworkAddressEntry(const QNetworkAddressEntry &other); QNetworkAddressEntry &operator=(const QNetworkAddressEntry &other); ~QNetworkAddressEntry(); + bool operator==(const QNetworkAddressEntry &other) const; inline bool operator!=(const QNetworkAddressEntry &other) const { return !(*this == other); } @@ -53,7 +52,7 @@ public: private: friend QNetworkInterfacePrivate; - QScopedPointer d; + QNetworkAddressEntryPrivate *d; }; class Q_NETWORK_EXPORT QNetworkInterface diff --git a/src/network/kernel/qnetworkinterface_p.h b/src/network/kernel/qnetworkinterface_p.h index 7034a2790..be1b739dc 100644 --- a/src/network/kernel/qnetworkinterface_p.h +++ b/src/network/kernel/qnetworkinterface_p.h @@ -55,17 +55,15 @@ public: class QNetworkInterfacePrivate: public QSharedData { public: - QNetworkInterfacePrivate() : index(0), flags(0) - { } - ~QNetworkInterfacePrivate() - { } + QNetworkInterfacePrivate() + : index(0), flags(0) + { + } int index; // interface index, if known QNetworkInterface::InterfaceFlags flags; - QString name; QString hardwareAddress; - QList addressEntries; static QList scan();