From 471f134cdd705f6a3909928f4d9d3703657a5170 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 12 May 2023 08:34:53 -0700 Subject: [PATCH] QDnsLookup: remove the explicit metatype registration for the Reply type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's unnecessary in Qt 6 if we use the new-style connect or if the type was fully defined in the compilation of the unit containing the moc output. Change-Id: I3e3bfef633af4130a03afffd175e6f4e87adf5e1 Reviewed-by: MÃ¥rten Nordheim --- src/network/kernel/qdnslookup.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/network/kernel/qdnslookup.cpp b/src/network/kernel/qdnslookup.cpp index 98c2dc0eed1..3ad19b0660c 100644 --- a/src/network/kernel/qdnslookup.cpp +++ b/src/network/kernel/qdnslookup.cpp @@ -231,8 +231,8 @@ const char *QDnsLookupPrivate::msgNoIpV6NameServerAdresses = QDnsLookup::QDnsLookup(QObject *parent) : QObject(*new QDnsLookupPrivate, parent) { - qRegisterMetaType(); } + /*! Constructs a QDnsLookup object for the given \a type and \a name and sets \a parent as the parent object. @@ -242,7 +242,6 @@ QDnsLookup::QDnsLookup(Type type, const QString &name, QObject *parent) : QObject(*new QDnsLookupPrivate, parent) { Q_D(QDnsLookup); - qRegisterMetaType(); d->name = name; d->type = type; } @@ -258,7 +257,6 @@ QDnsLookup::QDnsLookup(Type type, const QString &name, const QHostAddress &names : QObject(*new QDnsLookupPrivate, parent) { Q_D(QDnsLookup); - qRegisterMetaType(); d->name = name; d->type = type; d->nameserver = nameserver; @@ -475,8 +473,8 @@ void QDnsLookup::lookup() d->isFinished = false; d->reply = QDnsLookupReply(); d->runnable = new QDnsLookupRunnable(d->type, QUrl::toAce(d->name), d->nameserver); - connect(d->runnable, SIGNAL(finished(QDnsLookupReply)), - this, SLOT(_q_lookupFinished(QDnsLookupReply)), + connect(d->runnable, &QDnsLookupRunnable::finished, + this, [this](const QDnsLookupReply &reply) { d_func()->_q_lookupFinished(reply); }, Qt::BlockingQueuedConnection); #if QT_CONFIG(thread) theDnsLookupThreadPool()->start(d->runnable);