Skip to content

Commit

Permalink
QHostInfo: Remove useless code
Browse files Browse the repository at this point in the history
This code has not been doing anything interesting since symbian times

Change-Id: If652c75b85e20f631edc4f946aacdee479a19212
Reviewed-by: Timur Pocheptsov <[email protected]>
Reviewed-by: Thiago Macieira <[email protected]>
Reviewed-by: Edward Welbourne <[email protected]>
  • Loading branch information
Morten242 committed Jan 15, 2020
1 parent c3123c7 commit c4b7184
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 42 deletions.
21 changes: 0 additions & 21 deletions src/network/kernel/qhostinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,27 +383,6 @@ QHostInfo QHostInfo::fromName(const QString &name)
return hostInfo;
}

#ifndef QT_NO_BEARERMANAGEMENT
QHostInfo QHostInfoPrivate::fromName(const QString &name, QSharedPointer<QNetworkSession> session)
{
#if defined QHOSTINFO_DEBUG
qDebug("QHostInfoPrivate::fromName(\"%s\") with session %p",name.toLatin1().constData(), session.data());
#endif

QHostInfo hostInfo = QHostInfoAgent::fromName(name, session);
QHostInfoLookupManager* manager = theHostInfoLookupManager();
manager->cache.put(name, hostInfo);
return hostInfo;
}
#endif

#ifndef QT_NO_BEARERMANAGEMENT
QHostInfo QHostInfoAgent::fromName(const QString &hostName, QSharedPointer<QNetworkSession>)
{
return QHostInfoAgent::fromName(hostName);
}
#endif

QHostInfo QHostInfoAgent::reverseLookup(const QHostAddress &address)
{
QHostInfo results;
Expand Down
7 changes: 0 additions & 7 deletions src/network/kernel/qhostinfo_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ class QHostInfoAgent
{
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);
Expand All @@ -136,10 +133,6 @@ class QHostInfoPrivate
lookupId(0)
{
}
#ifndef QT_NO_BEARERMANAGEMENT
//not a public API yet
static QHostInfo fromName(const QString &hostName, QSharedPointer<QNetworkSession> networkSession);
#endif
static int lookupHostImpl(const QString &name,
const QObject *receiver,
QtPrivate::QSlotObjectBase *slotObj,
Expand Down
21 changes: 7 additions & 14 deletions src/network/socket/qabstractsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2144,20 +2144,13 @@ bool QAbstractSocket::waitForConnected(int msecs)
#endif
QHostInfo::abortHostLookup(d->hostLookupId);
d->hostLookupId = -1;
#ifndef QT_NO_BEARERMANAGEMENT
if (networkSession) {
d->_q_startConnecting(QHostInfoPrivate::fromName(d->hostName, networkSession));
} else
#endif
{
QHostAddress temp;
if (temp.setAddress(d->hostName)) {
QHostInfo info;
info.setAddresses(QList<QHostAddress>() << temp);
d->_q_startConnecting(info);
} else {
d->_q_startConnecting(QHostInfo::fromName(d->hostName));
}
QHostAddress temp;
if (temp.setAddress(d->hostName)) {
QHostInfo info;
info.setAddresses(QList<QHostAddress>() << temp);
d->_q_startConnecting(info);
} else {
d->_q_startConnecting(QHostInfo::fromName(d->hostName));
}
}
if (state() == UnconnectedState)
Expand Down

0 comments on commit c4b7184

Please sign in to comment.