mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
remove redundant QHostInfoCache member
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
9e09132f46
commit
067589df09
2 changed files with 3 additions and 5 deletions
|
@ -240,9 +240,8 @@ void Q_AUTOTEST_EXPORT qt_qhostinfo_enable_cache(bool e)
|
|||
}
|
||||
}
|
||||
|
||||
// cache for 60 seconds
|
||||
// cache 128 items
|
||||
QHostInfoCache::QHostInfoCache() : max_age(60), enabled(true), cache(128)
|
||||
// caches 128 items for for 60 seconds
|
||||
QHostInfoCache::QHostInfoCache() : enabled(true), cache(128)
|
||||
{
|
||||
#ifdef QT_QHOSTINFO_CACHE_DISABLED_BY_DEFAULT
|
||||
enabled = false;
|
||||
|
@ -266,7 +265,7 @@ QHostInfo QHostInfoCache::get(const QString &name, bool *valid) const
|
|||
{
|
||||
*valid = false;
|
||||
QHostInfoCacheElement *element = cache.object(name);
|
||||
if (element && element->age.elapsed() < max_age*1000) {
|
||||
if (element && element->age.elapsed() < 60000) {
|
||||
*valid = true;
|
||||
return element->info;
|
||||
}
|
||||
|
|
|
@ -71,7 +71,6 @@ class QHostInfoCache
|
|||
{
|
||||
public:
|
||||
QHostInfoCache();
|
||||
const int max_age; // seconds
|
||||
|
||||
QHostInfo get(const QString &name, bool *valid) const;
|
||||
void put(const QString &name, const QHostInfo &info);
|
||||
|
|
Loading…
Add table
Reference in a new issue