summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qhostinfo_p.h
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2019-04-24 17:06:15 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2019-04-30 10:57:56 +0000
commitdc3e5c48380ff564df9a232b13e2cf1fab65f66d (patch)
treebdb05570c29202b40406583b0d970968a5c58a8b /src/network/kernel/qhostinfo_p.h
parentd647cf85fa3813a65921266a9998cd2e54e5f2f9 (diff)
Consolidate Unix and Windows implementations of QHostInfo::fromName
The implementations were practically identical, so we can just move the code into qhostinfo.cpp, cleaning up things along the way. Since QHostInfoAgent is an internal class, add the shared code as additional static helper functions. And since half the code already used QCoreApplication::translate anyway, we can remove the QObject inheritance which was only added for getting a tr(). Change-Id: I58eafbdc3e7d06d2e898486a1add63cd63d98c96 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/network/kernel/qhostinfo_p.h')
-rw-r--r--src/network/kernel/qhostinfo_p.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h
index da02163ddf..3c0ee2a0d8 100644
--- a/src/network/kernel/qhostinfo_p.h
+++ b/src/network/kernel/qhostinfo_p.h
@@ -127,15 +127,16 @@ Q_SIGNALS:
void resultsReady(const QHostInfo &info);
};
-// needs to be QObject because fromName calls tr()
-class QHostInfoAgent : public QObject
+class QHostInfoAgent
{
- Q_OBJECT
public:
static QHostInfo fromName(const QString &hostName);
#ifndef QT_NO_BEARERMANAGEMENT
static QHostInfo fromName(const QString &hostName, QSharedPointer<QNetworkSession> networkSession);
#endif
+private:
+ static QHostInfo lookup(const QString &hostName);
+ static QHostInfo reverseLookup(const QHostAddress &address);
};
class QHostInfoPrivate