mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
Merge pull request #12942 from Chocobo1/cacheCountry
Cache country lookup result in PeerInfo class
This commit is contained in:
commit
9d135441db
2 changed files with 7 additions and 1 deletions
|
@ -64,7 +64,9 @@ bool PeerInfo::fromLSD() const
|
||||||
#ifndef DISABLE_COUNTRIES_RESOLUTION
|
#ifndef DISABLE_COUNTRIES_RESOLUTION
|
||||||
QString PeerInfo::country() const
|
QString PeerInfo::country() const
|
||||||
{
|
{
|
||||||
return Net::GeoIPManager::instance()->lookup(address().ip);
|
if (m_country.isEmpty())
|
||||||
|
m_country = Net::GeoIPManager::instance()->lookup(address().ip);
|
||||||
|
return m_country;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,10 @@ namespace BitTorrent
|
||||||
qreal m_relevance = 0;
|
qreal m_relevance = 0;
|
||||||
QString m_flags;
|
QString m_flags;
|
||||||
QString m_flagsDescription;
|
QString m_flagsDescription;
|
||||||
|
|
||||||
|
#ifndef DISABLE_COUNTRIES_RESOLUTION
|
||||||
|
mutable QString m_country;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue