diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d32cd9d4..68e80776e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,8 +58,6 @@ endif() # we need options here, at the top level, because they are used not only in "src" subdir, but in the "dist" dir too include(CompileFeature) -optional_compile_definitions(COUNTRIES_RESOLUTION FEATURE DESCRIPTION "Enable resolving peers IP addresses to countries" - DEFAULT ON DISABLED DISABLE_COUNTRIES_RESOLUTION) optional_compile_definitions(STACKTRACE FEATURE DESCRIPTION "Enable stacktraces" DEFAULT ON ENABLED STACKTRACE) optional_compile_definitions(GUI FEATURE DESCRIPTION "Build GUI application" diff --git a/src/app/application.cpp b/src/app/application.cpp index 253fc14e8..f1ff45841 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -566,9 +566,7 @@ int Application::exec(const QStringList ¶ms) connect(BitTorrent::Session::instance(), &BitTorrent::Session::torrentFinished, this, &Application::torrentFinished); connect(BitTorrent::Session::instance(), &BitTorrent::Session::allTorrentsFinished, this, &Application::allTorrentsFinished, Qt::QueuedConnection); -#ifndef DISABLE_COUNTRIES_RESOLUTION Net::GeoIPManager::initInstance(); -#endif ScanFoldersModel::initInstance(); #ifndef DISABLE_WEBUI @@ -760,9 +758,7 @@ void Application::cleanup() ScanFoldersModel::freeInstance(); BitTorrent::Session::freeInstance(); -#ifndef DISABLE_COUNTRIES_RESOLUTION Net::GeoIPManager::freeInstance(); -#endif Net::DownloadManager::freeInstance(); Net::ProxyConfigurationManager::freeInstance(); Preferences::freeInstance(); diff --git a/src/base/bittorrent/peerinfo.cpp b/src/base/bittorrent/peerinfo.cpp index d3c263979..445380bf7 100644 --- a/src/base/bittorrent/peerinfo.cpp +++ b/src/base/bittorrent/peerinfo.cpp @@ -59,14 +59,12 @@ bool PeerInfo::fromLSD() const return static_cast(m_nativeInfo.source & lt::peer_info::lsd); } -#ifndef DISABLE_COUNTRIES_RESOLUTION QString PeerInfo::country() const { if (m_country.isEmpty()) m_country = Net::GeoIPManager::instance()->lookup(address().ip); return m_country; } -#endif bool PeerInfo::isInteresting() const { diff --git a/src/base/bittorrent/peerinfo.h b/src/base/bittorrent/peerinfo.h index 251f161b2..0e6b18842 100644 --- a/src/base/bittorrent/peerinfo.h +++ b/src/base/bittorrent/peerinfo.h @@ -89,9 +89,7 @@ namespace BitTorrent qreal relevance() const; QString flags() const; QString flagsDescription() const; -#ifndef DISABLE_COUNTRIES_RESOLUTION QString country() const; -#endif int downloadingPieceIndex() const; private: @@ -103,9 +101,7 @@ namespace BitTorrent QString m_flags; QString m_flagsDescription; -#ifndef DISABLE_COUNTRIES_RESOLUTION mutable QString m_country; -#endif }; } diff --git a/src/config.h.cmakein b/src/config.h.cmakein index 5d6a30c32..7cd0d40a2 100644 --- a/src/config.h.cmakein +++ b/src/config.h.cmakein @@ -2,7 +2,6 @@ #ifndef QBT_USE_GUI #define DISABLE_GUI -#define DISABLE_COUNTRIES_RESOLUTION #endif #cmakedefine QBT_USE_WEBUI diff --git a/src/webui/api/synccontroller.cpp b/src/webui/api/synccontroller.cpp index 4965f365b..86b900893 100644 --- a/src/webui/api/synccontroller.cpp +++ b/src/webui/api/synccontroller.cpp @@ -522,11 +522,7 @@ void SyncController::torrentPeersAction() const QVector peersList = torrent->peers(); -#ifndef DISABLE_COUNTRIES_RESOLUTION bool resolvePeerCountries = Preferences::instance()->resolvePeerCountries(); -#else - bool resolvePeerCountries = false; -#endif data[KEY_SYNC_TORRENT_PEERS_SHOW_FLAGS] = resolvePeerCountries; @@ -549,12 +545,10 @@ void SyncController::torrentPeersAction() {KEY_PEER_FILES, torrent->info().filesForPiece(pi.downloadingPieceIndex()).join('\n')} }; -#ifndef DISABLE_COUNTRIES_RESOLUTION if (resolvePeerCountries) { peer[KEY_PEER_COUNTRY_CODE] = pi.country().toLower(); peer[KEY_PEER_COUNTRY] = Net::GeoIPManager::CountryName(pi.country()); } -#endif peers[pi.address().ip.toString() + ':' + QString::number(pi.address().port)] = peer; }