QHostInfo: remove unused QAbstractHostInfoLookupManager
If it was used in the past, it no longer is, and can't be, because it's not exported. Change-Id: Ifb9c353e756add5b57bf0c5706c075bb2eb41d83 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
parent
cab920d52c
commit
2851f6eae9
@ -392,7 +392,7 @@ QHostInfo QHostInfo::fromName(const QString &name)
|
||||
#endif
|
||||
|
||||
QHostInfo hostInfo = QHostInfoAgent::fromName(name);
|
||||
QAbstractHostInfoLookupManager* manager = theHostInfoLookupManager();
|
||||
QHostInfoLookupManager* manager = theHostInfoLookupManager();
|
||||
manager->cache.put(name, hostInfo);
|
||||
return hostInfo;
|
||||
}
|
||||
@ -405,7 +405,7 @@ QHostInfo QHostInfoPrivate::fromName(const QString &name, QSharedPointer<QNetwor
|
||||
#endif
|
||||
|
||||
QHostInfo hostInfo = QHostInfoAgent::fromName(name, session);
|
||||
QAbstractHostInfoLookupManager* manager = theHostInfoLookupManager();
|
||||
QHostInfoLookupManager* manager = theHostInfoLookupManager();
|
||||
manager->cache.put(name, hostInfo);
|
||||
return hostInfo;
|
||||
}
|
||||
@ -1077,7 +1077,7 @@ QHostInfo qt_qhostinfo_lookup(const QString &name, QObject *receiver, const char
|
||||
*id = -1;
|
||||
|
||||
// check cache
|
||||
QAbstractHostInfoLookupManager* manager = theHostInfoLookupManager();
|
||||
QHostInfoLookupManager* manager = theHostInfoLookupManager();
|
||||
if (manager && manager->cache.isEnabled()) {
|
||||
QHostInfo info = manager->cache.get(name, valid);
|
||||
if (*valid) {
|
||||
@ -1094,7 +1094,7 @@ QHostInfo qt_qhostinfo_lookup(const QString &name, QObject *receiver, const char
|
||||
|
||||
void qt_qhostinfo_clear_cache()
|
||||
{
|
||||
QAbstractHostInfoLookupManager* manager = theHostInfoLookupManager();
|
||||
QHostInfoLookupManager* manager = theHostInfoLookupManager();
|
||||
if (manager) {
|
||||
manager->clear();
|
||||
}
|
||||
@ -1103,7 +1103,7 @@ void qt_qhostinfo_clear_cache()
|
||||
#ifdef QT_BUILD_INTERNAL
|
||||
void Q_AUTOTEST_EXPORT qt_qhostinfo_enable_cache(bool e)
|
||||
{
|
||||
QAbstractHostInfoLookupManager* manager = theHostInfoLookupManager();
|
||||
QHostInfoLookupManager* manager = theHostInfoLookupManager();
|
||||
if (manager) {
|
||||
manager->cache.setEnabled(e);
|
||||
}
|
||||
@ -1111,7 +1111,7 @@ void Q_AUTOTEST_EXPORT qt_qhostinfo_enable_cache(bool e)
|
||||
|
||||
void qt_qhostinfo_cache_inject(const QString &hostname, const QHostInfo &resolution)
|
||||
{
|
||||
QAbstractHostInfoLookupManager* manager = theHostInfoLookupManager();
|
||||
QHostInfoLookupManager* manager = theHostInfoLookupManager();
|
||||
if (!manager || !manager->cache.isEnabled())
|
||||
return;
|
||||
|
||||
@ -1167,9 +1167,4 @@ void QHostInfoCache::clear()
|
||||
cache.clear();
|
||||
}
|
||||
|
||||
QAbstractHostInfoLookupManager* QAbstractHostInfoLookupManager::globalInstance()
|
||||
{
|
||||
return theHostInfoLookupManager();
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -208,30 +208,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class QAbstractHostInfoLookupManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
~QAbstractHostInfoLookupManager() {}
|
||||
virtual void clear() = 0;
|
||||
|
||||
QHostInfoCache cache;
|
||||
|
||||
protected:
|
||||
QAbstractHostInfoLookupManager() {}
|
||||
static QAbstractHostInfoLookupManager* globalInstance();
|
||||
|
||||
};
|
||||
|
||||
class QHostInfoLookupManager : public QAbstractHostInfoLookupManager
|
||||
class QHostInfoLookupManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QHostInfoLookupManager();
|
||||
~QHostInfoLookupManager();
|
||||
|
||||
void clear() override;
|
||||
void clear();
|
||||
|
||||
// called from QHostInfo
|
||||
void scheduleLookup(QHostInfoRunnable *r);
|
||||
@ -241,6 +225,8 @@ public:
|
||||
void lookupFinished(QHostInfoRunnable *r);
|
||||
bool wasAborted(int id);
|
||||
|
||||
QHostInfoCache cache;
|
||||
|
||||
friend class QHostInfoRunnable;
|
||||
protected:
|
||||
#if QT_CONFIG(thread)
|
||||
|
Loading…
Reference in New Issue
Block a user