diff --git a/Changelog b/Changelog index 447474715..d9f87855e 100644 --- a/Changelog +++ b/Changelog @@ -20,6 +20,7 @@ - BUGFIX: The user can disable permanently recursive torrent download - BUGFIX: Peer Exchange status is now correctly reported - BUGFIX: Use an INI file instead of the registry on Windows (More reliable) + - BUGFIX: Removed client spoofing feature to avoid tracker blacklisting - COSMETIC: Display peers country name in tooltip - COSMETIC: Display number of torrents in transfers tab label - COSMETIC: Simplified program preferences diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 4ea86a25f..097f1415f 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -95,6 +95,7 @@ Bittorrent::Bittorrent() version << VERSION_MINOR; version << VERSION_BUGFIX; version << VERSION_TYPE; +#ifdef CLIENT_USURPATION QString peer_id = Preferences::getPeerID(); if(peer_id.size() != 2) peer_id = "qB"; if(peer_id != "qB") { @@ -110,6 +111,9 @@ Bittorrent::Bittorrent() version.replace(i, ver.toInt()); } } +#else + const QString peer_id = "qB"; +#endif // Construct session s = new session(fingerprint(peer_id.toLocal8Bit().constData(), version.at(0), version.at(1), version.at(2), version.at(3)), 0); std::cout << "Peer ID: " << fingerprint(peer_id.toLocal8Bit().constData(), version.at(0), version.at(1), version.at(2), version.at(3)).to_string() << std::endl; @@ -407,6 +411,7 @@ void Bittorrent::configureSession() { } // * Session settings session_settings sessionSettings; +#ifdef CLIENT_USURPATION QString peer_id = Preferences::getPeerID(); if(peer_id.size() != 2) peer_id = "qB"; if(peer_id == "UT") { @@ -429,6 +434,9 @@ void Bittorrent::configureSession() { } } } +#else + sessionSettings.user_agent = "qBittorrent "VERSION; +#endif std::cout << "HTTP user agent is " << sessionSettings.user_agent << std::endl; addConsoleMessage(tr("HTTP user agent is %1").arg(misc::toQString(sessionSettings.user_agent))); diff --git a/src/eventmanager.cpp b/src/eventmanager.cpp index ce7be499d..c0a8cb9df 100644 --- a/src/eventmanager.cpp +++ b/src/eventmanager.cpp @@ -208,12 +208,14 @@ void EventManager::setGlobalPreferences(QVariantMap m) const { Preferences::setLSDEnabled(m["lsd"].toBool()); if(m.contains("encryption")) Preferences::setEncryptionSetting(m["encryption"].toInt()); +#ifdef CLIENT_USURPATION if(m.contains("peer_id")) Preferences::setPeerID(m["peer_id"].toString()); if(m.contains("peer_version")) Preferences::setClientVersion(m["peer_version"].toString()); if(m.contains("peer_build")) Preferences::setClientBuild(m["peer_build"].toString()); +#endif // Proxy if(m.contains("proxy_type")) Preferences::setPeerProxyType(m["proxy_type"].toInt()); @@ -295,9 +297,11 @@ QVariantMap EventManager::getGlobalPreferences() const { data["pex"] = Preferences::isPeXEnabled(); data["lsd"] = Preferences::isLSDEnabled(); data["encryption"] = Preferences::getEncryptionSetting(); +#ifdef CLIENT_USURPATION data["peer_id"] = Preferences::getPeerID(); data["peer_version"] = Preferences::getClientVersion(); data["peer_build"] = Preferences::getClientBuild(); +#endif // Proxy data["proxy_type"] = Preferences::getPeerProxyType(); data["proxy_ip"] = Preferences::getPeerProxyIp(); diff --git a/src/options_imp.cpp b/src/options_imp.cpp index ab481fc13..071935e0f 100644 --- a/src/options_imp.cpp +++ b/src/options_imp.cpp @@ -140,7 +140,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ // Load week days (scheduler) for(uint i=1; i<=7; ++i) { -#ifdef QT_4_5 +#if QT_VERSION >= 0x040500 schedule_days->addItem(QDate::longDayName(i, QDate::StandaloneFormat)); #else schedule_days->addItem(QDate::longDayName(i)); @@ -271,6 +271,11 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ adv_layout->addWidget(advancedSettings); scrollArea_advanced->setLayout(adv_layout); connect(advancedSettings, SIGNAL(settingsChanged()), this, SLOT(enableApplyButton())); + +#ifndef CLIENT_USURPATION + groupBox_usurpation->setVisible(false); +#endif + // Adapt size show(); loadWindowState(); @@ -447,6 +452,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ settings.setValue(QString::fromUtf8("sameDHTPortAsBT"), isDHTPortSameAsBT()); settings.setValue(QString::fromUtf8("DHTPort"), getDHTPort()); settings.setValue(QString::fromUtf8("LSD"), isLSDEnabled()); +#ifndef CLIENT_USURPATION // Peer ID usurpation switch(comboPeerID->currentIndex()) { case 3: // KTorrent @@ -465,6 +471,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ default: //qBittorrent Preferences::setPeerID("qB"); } +#endif settings.setValue(QString::fromUtf8("Encryption"), getEncryptionSetting()); Preferences::setMaxRatio(getMaxRatio()); Preferences::setMaxRatioAction(comboRatioLimitAct->currentIndex()); @@ -755,6 +762,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ checkPeX->setChecked(Preferences::isPeXEnabled()); checkLSD->setChecked(Preferences::isLSDEnabled()); // Peer ID usurpation +#ifdef CLIENT_USURPATION QString peer_id = Preferences::getPeerID(); if(peer_id == "UT") { // uTorrent @@ -780,6 +788,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ } } } +#endif comboEncryption->setCurrentIndex(Preferences::getEncryptionSetting()); // Ratio limit floatValue = Preferences::getMaxRatio(); diff --git a/src/src.pro b/src/src.pro index 6769d177f..70bdd017a 100644 --- a/src/src.pro +++ b/src/src.pro @@ -421,4 +421,7 @@ SOURCES += main.cpp \ } } +# NO CLIENT USURPATION +# DEFINES += CLIENT_USURPATION + DESTDIR = . diff --git a/src/ui/options.ui b/src/ui/options.ui index 505e4744a..0bda07a6a 100644 --- a/src/ui/options.ui +++ b/src/ui/options.ui @@ -1570,7 +1570,7 @@ QGroupBox { 0 - -106 + 0 552 496 @@ -1748,7 +1748,7 @@ QGroupBox { - + Client whitelisting workaround diff --git a/src/webui/preferences_content.html b/src/webui/preferences_content.html index 045c34810..a3363f647 100644 --- a/src/webui/preferences_content.html +++ b/src/webui/preferences_content.html @@ -75,6 +75,7 @@
+