mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Use enums for settings
This commit is contained in:
parent
3f5fa0025d
commit
2da2054ccf
@ -301,7 +301,8 @@ Session::Session(QObject *parent)
|
|||||||
, m_maxUploadsPerTorrent(BITTORRENT_SESSION_KEY("MaxUploadsPerTorrent"), -1, lowerLimited(0, -1))
|
, m_maxUploadsPerTorrent(BITTORRENT_SESSION_KEY("MaxUploadsPerTorrent"), -1, lowerLimited(0, -1))
|
||||||
, m_isUTPEnabled(BITTORRENT_SESSION_KEY("uTPEnabled"), true)
|
, m_isUTPEnabled(BITTORRENT_SESSION_KEY("uTPEnabled"), true)
|
||||||
, m_isUTPRateLimited(BITTORRENT_SESSION_KEY("uTPRateLimited"), true)
|
, m_isUTPRateLimited(BITTORRENT_SESSION_KEY("uTPRateLimited"), true)
|
||||||
, m_utpMixedMode(BITTORRENT_SESSION_KEY("uTPMixedMode"), m_isUTPEnabled, clampValue(0, 1))
|
, m_utpMixedMode(BITTORRENT_SESSION_KEY("uTPMixedMode"), MixedModeAlgorithm::Proportional
|
||||||
|
, clampValue(MixedModeAlgorithm::TCP, MixedModeAlgorithm::Proportional))
|
||||||
, m_multiConnectionsPerIpEnabled(BITTORRENT_SESSION_KEY("MultiConnectionsPerIp"), false)
|
, m_multiConnectionsPerIpEnabled(BITTORRENT_SESSION_KEY("MultiConnectionsPerIp"), false)
|
||||||
, m_isAddTrackersEnabled(BITTORRENT_SESSION_KEY("AddTrackersEnabled"), false)
|
, m_isAddTrackersEnabled(BITTORRENT_SESSION_KEY("AddTrackersEnabled"), false)
|
||||||
, m_additionalTrackers(BITTORRENT_SESSION_KEY("AdditionalTrackers"))
|
, m_additionalTrackers(BITTORRENT_SESSION_KEY("AdditionalTrackers"))
|
||||||
@ -330,8 +331,10 @@ Session::Session(QObject *parent)
|
|||||||
, m_encryption(BITTORRENT_SESSION_KEY("Encryption"), 0)
|
, m_encryption(BITTORRENT_SESSION_KEY("Encryption"), 0)
|
||||||
, m_isForceProxyEnabled(BITTORRENT_SESSION_KEY("ForceProxy"), true)
|
, m_isForceProxyEnabled(BITTORRENT_SESSION_KEY("ForceProxy"), true)
|
||||||
, m_isProxyPeerConnectionsEnabled(BITTORRENT_SESSION_KEY("ProxyPeerConnections"), false)
|
, m_isProxyPeerConnectionsEnabled(BITTORRENT_SESSION_KEY("ProxyPeerConnections"), false)
|
||||||
, m_chokingAlgorithm(BITTORRENT_SESSION_KEY("ChokingAlgorithm"), 0, clampValue(0, 2))
|
, m_chokingAlgorithm(BITTORRENT_SESSION_KEY("ChokingAlgorithm"), ChokingAlgorithm::FixedSlots
|
||||||
, m_seedChokingAlgorithm(BITTORRENT_SESSION_KEY("SeedChokingAlgorithm"), 1, clampValue(0, 2))
|
, clampValue(ChokingAlgorithm::FixedSlots, ChokingAlgorithm::RateBased))
|
||||||
|
, m_seedChokingAlgorithm(BITTORRENT_SESSION_KEY("SeedChokingAlgorithm"), SeedChokingAlgorithm::FastestUpload
|
||||||
|
, clampValue(SeedChokingAlgorithm::RoundRobin, SeedChokingAlgorithm::AntiLeech))
|
||||||
, m_storedCategories(BITTORRENT_SESSION_KEY("Categories"))
|
, m_storedCategories(BITTORRENT_SESSION_KEY("Categories"))
|
||||||
, m_storedTags(BITTORRENT_SESSION_KEY("Tags"))
|
, m_storedTags(BITTORRENT_SESSION_KEY("Tags"))
|
||||||
, m_maxRatioAction(BITTORRENT_SESSION_KEY("MaxRatioAction"), Pause)
|
, m_maxRatioAction(BITTORRENT_SESSION_KEY("MaxRatioAction"), Pause)
|
||||||
@ -1324,7 +1327,15 @@ void Session::configure(libtorrent::settings_pack &settingsPack)
|
|||||||
// uTP
|
// uTP
|
||||||
settingsPack.set_bool(libt::settings_pack::enable_incoming_utp, isUTPEnabled());
|
settingsPack.set_bool(libt::settings_pack::enable_incoming_utp, isUTPEnabled());
|
||||||
settingsPack.set_bool(libt::settings_pack::enable_outgoing_utp, isUTPEnabled());
|
settingsPack.set_bool(libt::settings_pack::enable_outgoing_utp, isUTPEnabled());
|
||||||
settingsPack.set_int(libt::settings_pack::mixed_mode_algorithm, utpMixedMode());
|
switch (utpMixedMode()) {
|
||||||
|
case MixedModeAlgorithm::TCP:
|
||||||
|
default:
|
||||||
|
settingsPack.set_int(libt::settings_pack::mixed_mode_algorithm, libt::settings_pack::prefer_tcp);
|
||||||
|
break;
|
||||||
|
case MixedModeAlgorithm::Proportional:
|
||||||
|
settingsPack.set_int(libt::settings_pack::mixed_mode_algorithm, libt::settings_pack::peer_proportional);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
settingsPack.set_bool(libt::settings_pack::allow_multiple_connections_per_ip, multiConnectionsPerIpEnabled());
|
settingsPack.set_bool(libt::settings_pack::allow_multiple_connections_per_ip, multiConnectionsPerIpEnabled());
|
||||||
|
|
||||||
@ -1336,15 +1347,27 @@ void Session::configure(libtorrent::settings_pack &settingsPack)
|
|||||||
settingsPack.set_bool(libt::settings_pack::enable_lsd, isLSDEnabled());
|
settingsPack.set_bool(libt::settings_pack::enable_lsd, isLSDEnabled());
|
||||||
|
|
||||||
switch (chokingAlgorithm()) {
|
switch (chokingAlgorithm()) {
|
||||||
case 0:
|
case ChokingAlgorithm::FixedSlots:
|
||||||
default:
|
default:
|
||||||
settingsPack.set_int(libt::settings_pack::choking_algorithm, libt::settings_pack::fixed_slots_choker);
|
settingsPack.set_int(libt::settings_pack::choking_algorithm, libt::settings_pack::fixed_slots_choker);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case ChokingAlgorithm::RateBased:
|
||||||
settingsPack.set_int(libt::settings_pack::choking_algorithm, libt::settings_pack::rate_based_choker);
|
settingsPack.set_int(libt::settings_pack::choking_algorithm, libt::settings_pack::rate_based_choker);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
settingsPack.set_int(libt::settings_pack::seed_choking_algorithm, seedChokingAlgorithm());
|
|
||||||
|
switch (seedChokingAlgorithm()) {
|
||||||
|
case SeedChokingAlgorithm::RoundRobin:
|
||||||
|
settingsPack.set_int(libt::settings_pack::seed_choking_algorithm, libt::settings_pack::round_robin);
|
||||||
|
break;
|
||||||
|
case SeedChokingAlgorithm::FastestUpload:
|
||||||
|
default:
|
||||||
|
settingsPack.set_int(libt::settings_pack::seed_choking_algorithm, libt::settings_pack::fastest_upload);
|
||||||
|
break;
|
||||||
|
case SeedChokingAlgorithm::AntiLeech:
|
||||||
|
settingsPack.set_int(libt::settings_pack::seed_choking_algorithm, libt::settings_pack::anti_leech);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::configurePeerClasses()
|
void Session::configurePeerClasses()
|
||||||
@ -1562,7 +1585,15 @@ void Session::configure(libtorrent::session_settings &sessionSettings)
|
|||||||
sessionSettings.enable_outgoing_utp = isUTPEnabled();
|
sessionSettings.enable_outgoing_utp = isUTPEnabled();
|
||||||
// uTP rate limiting
|
// uTP rate limiting
|
||||||
sessionSettings.rate_limit_utp = isUTPRateLimited();
|
sessionSettings.rate_limit_utp = isUTPRateLimited();
|
||||||
sessionSettings.mixed_mode_algorithm = utpMixedMode();
|
switch (utpMixedMode()) {
|
||||||
|
case MixedModeAlgorithm::TCP:
|
||||||
|
default:
|
||||||
|
sessionSettings.mixed_mode_algorithm = libt::session_settings::prefer_tcp;
|
||||||
|
break;
|
||||||
|
case MixedModeAlgorithm::Proportional:
|
||||||
|
sessionSettings.mixed_mode_algorithm = libt::session_settings::peer_proportional;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
sessionSettings.allow_multiple_connections_per_ip = multiConnectionsPerIpEnabled();
|
sessionSettings.allow_multiple_connections_per_ip = multiConnectionsPerIpEnabled();
|
||||||
|
|
||||||
@ -1587,15 +1618,27 @@ void Session::configure(libtorrent::session_settings &sessionSettings)
|
|||||||
m_nativeSession->stop_lsd();
|
m_nativeSession->stop_lsd();
|
||||||
|
|
||||||
switch (chokingAlgorithm()) {
|
switch (chokingAlgorithm()) {
|
||||||
case 0:
|
case ChokingAlgorithm::FixedSlots:
|
||||||
default:
|
default:
|
||||||
sessionSettings.choking_algorithm = libt::session_settings::fixed_slots_choker;
|
sessionSettings.choking_algorithm = libt::session_settings::fixed_slots_choker;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case ChokingAlgorithm::RateBased:
|
||||||
sessionSettings.choking_algorithm = libt::session_settings::rate_based_choker;
|
sessionSettings.choking_algorithm = libt::session_settings::rate_based_choker;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sessionSettings.seed_choking_algorithm = seedChokingAlgorithm();
|
|
||||||
|
switch (seedChokingAlgorithm()) {
|
||||||
|
case SeedChokingAlgorithm::RoundRobin:
|
||||||
|
sessionSettings.seed_choking_algorithm = libt::session_settings::round_robin;
|
||||||
|
break;
|
||||||
|
case SeedChokingAlgorithm::FastestUpload:
|
||||||
|
default:
|
||||||
|
sessionSettings.seed_choking_algorithm = libt::session_settings::fastest_upload;
|
||||||
|
break;
|
||||||
|
case SeedChokingAlgorithm::AntiLeech:
|
||||||
|
sessionSettings.seed_choking_algorithm = libt::session_settings::anti_leech;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2697,12 +2740,12 @@ void Session::setProxyPeerConnectionsEnabled(bool enabled)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int Session::chokingAlgorithm() const
|
ChokingAlgorithm Session::chokingAlgorithm() const
|
||||||
{
|
{
|
||||||
return m_chokingAlgorithm;
|
return m_chokingAlgorithm;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::setChokingAlgorithm(int mode)
|
void Session::setChokingAlgorithm(ChokingAlgorithm mode)
|
||||||
{
|
{
|
||||||
if (mode == m_chokingAlgorithm) return;
|
if (mode == m_chokingAlgorithm) return;
|
||||||
|
|
||||||
@ -2710,12 +2753,12 @@ void Session::setChokingAlgorithm(int mode)
|
|||||||
configureDeferred();
|
configureDeferred();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Session::seedChokingAlgorithm() const
|
SeedChokingAlgorithm Session::seedChokingAlgorithm() const
|
||||||
{
|
{
|
||||||
return m_seedChokingAlgorithm;
|
return m_seedChokingAlgorithm;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::setSeedChokingAlgorithm(int mode)
|
void Session::setSeedChokingAlgorithm(SeedChokingAlgorithm mode)
|
||||||
{
|
{
|
||||||
if (mode == m_seedChokingAlgorithm) return;
|
if (mode == m_seedChokingAlgorithm) return;
|
||||||
|
|
||||||
@ -3220,12 +3263,12 @@ void Session::setUTPRateLimited(bool limited)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int Session::utpMixedMode() const
|
MixedModeAlgorithm Session::utpMixedMode() const
|
||||||
{
|
{
|
||||||
return m_utpMixedMode;
|
return m_utpMixedMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::setUtpMixedMode(int mode)
|
void Session::setUtpMixedMode(MixedModeAlgorithm mode)
|
||||||
{
|
{
|
||||||
if (mode == m_utpMixedMode) return;
|
if (mode == m_utpMixedMode) return;
|
||||||
|
|
||||||
|
@ -151,6 +151,38 @@ namespace BitTorrent
|
|||||||
uint nbErrored = 0;
|
uint nbErrored = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class SessionSettingsEnums
|
||||||
|
{
|
||||||
|
Q_GADGET
|
||||||
|
|
||||||
|
public:
|
||||||
|
// TODO: remove `SessionSettingsEnums` wrapper when we can use `Q_ENUM_NS` directly (QT >= 5.8 only)
|
||||||
|
enum class ChokingAlgorithm : int
|
||||||
|
{
|
||||||
|
FixedSlots = 0,
|
||||||
|
RateBased = 1
|
||||||
|
};
|
||||||
|
Q_ENUM(ChokingAlgorithm)
|
||||||
|
|
||||||
|
enum class SeedChokingAlgorithm : int
|
||||||
|
{
|
||||||
|
RoundRobin = 0,
|
||||||
|
FastestUpload = 1,
|
||||||
|
AntiLeech = 2
|
||||||
|
};
|
||||||
|
Q_ENUM(SeedChokingAlgorithm)
|
||||||
|
|
||||||
|
enum class MixedModeAlgorithm : int
|
||||||
|
{
|
||||||
|
TCP = 0,
|
||||||
|
Proportional = 1
|
||||||
|
};
|
||||||
|
Q_ENUM(MixedModeAlgorithm)
|
||||||
|
};
|
||||||
|
using ChokingAlgorithm = SessionSettingsEnums::ChokingAlgorithm;
|
||||||
|
using SeedChokingAlgorithm = SessionSettingsEnums::SeedChokingAlgorithm;
|
||||||
|
using MixedModeAlgorithm = SessionSettingsEnums::MixedModeAlgorithm;
|
||||||
|
|
||||||
#if LIBTORRENT_VERSION_NUM >= 10100
|
#if LIBTORRENT_VERSION_NUM >= 10100
|
||||||
struct SessionMetricIndices
|
struct SessionMetricIndices
|
||||||
{
|
{
|
||||||
@ -317,10 +349,10 @@ namespace BitTorrent
|
|||||||
void setForceProxyEnabled(bool enabled);
|
void setForceProxyEnabled(bool enabled);
|
||||||
bool isProxyPeerConnectionsEnabled() const;
|
bool isProxyPeerConnectionsEnabled() const;
|
||||||
void setProxyPeerConnectionsEnabled(bool enabled);
|
void setProxyPeerConnectionsEnabled(bool enabled);
|
||||||
int chokingAlgorithm() const;
|
ChokingAlgorithm chokingAlgorithm() const;
|
||||||
void setChokingAlgorithm(int mode);
|
void setChokingAlgorithm(ChokingAlgorithm mode);
|
||||||
int seedChokingAlgorithm() const;
|
SeedChokingAlgorithm seedChokingAlgorithm() const;
|
||||||
void setSeedChokingAlgorithm(int mode);
|
void setSeedChokingAlgorithm(SeedChokingAlgorithm mode);
|
||||||
bool isAddTrackersEnabled() const;
|
bool isAddTrackersEnabled() const;
|
||||||
void setAddTrackersEnabled(bool enabled);
|
void setAddTrackersEnabled(bool enabled);
|
||||||
QString additionalTrackers() const;
|
QString additionalTrackers() const;
|
||||||
@ -385,8 +417,8 @@ namespace BitTorrent
|
|||||||
void setUTPEnabled(bool enabled);
|
void setUTPEnabled(bool enabled);
|
||||||
bool isUTPRateLimited() const;
|
bool isUTPRateLimited() const;
|
||||||
void setUTPRateLimited(bool limited);
|
void setUTPRateLimited(bool limited);
|
||||||
int utpMixedMode() const;
|
MixedModeAlgorithm utpMixedMode() const;
|
||||||
void setUtpMixedMode(int mode);
|
void setUtpMixedMode(MixedModeAlgorithm mode);
|
||||||
bool multiConnectionsPerIpEnabled() const;
|
bool multiConnectionsPerIpEnabled() const;
|
||||||
void setMultiConnectionsPerIpEnabled(bool enabled);
|
void setMultiConnectionsPerIpEnabled(bool enabled);
|
||||||
bool isTrackerFilteringEnabled() const;
|
bool isTrackerFilteringEnabled() const;
|
||||||
@ -617,7 +649,7 @@ namespace BitTorrent
|
|||||||
CachedSettingValue<int> m_maxUploadsPerTorrent;
|
CachedSettingValue<int> m_maxUploadsPerTorrent;
|
||||||
CachedSettingValue<bool> m_isUTPEnabled;
|
CachedSettingValue<bool> m_isUTPEnabled;
|
||||||
CachedSettingValue<bool> m_isUTPRateLimited;
|
CachedSettingValue<bool> m_isUTPRateLimited;
|
||||||
CachedSettingValue<int> m_utpMixedMode;
|
CachedSettingValue<MixedModeAlgorithm> m_utpMixedMode;
|
||||||
CachedSettingValue<bool> m_multiConnectionsPerIpEnabled;
|
CachedSettingValue<bool> m_multiConnectionsPerIpEnabled;
|
||||||
CachedSettingValue<bool> m_isAddTrackersEnabled;
|
CachedSettingValue<bool> m_isAddTrackersEnabled;
|
||||||
CachedSettingValue<QString> m_additionalTrackers;
|
CachedSettingValue<QString> m_additionalTrackers;
|
||||||
@ -646,8 +678,8 @@ namespace BitTorrent
|
|||||||
CachedSettingValue<int> m_encryption;
|
CachedSettingValue<int> m_encryption;
|
||||||
CachedSettingValue<bool> m_isForceProxyEnabled;
|
CachedSettingValue<bool> m_isForceProxyEnabled;
|
||||||
CachedSettingValue<bool> m_isProxyPeerConnectionsEnabled;
|
CachedSettingValue<bool> m_isProxyPeerConnectionsEnabled;
|
||||||
CachedSettingValue<int> m_chokingAlgorithm;
|
CachedSettingValue<ChokingAlgorithm> m_chokingAlgorithm;
|
||||||
CachedSettingValue<int> m_seedChokingAlgorithm;
|
CachedSettingValue<SeedChokingAlgorithm> m_seedChokingAlgorithm;
|
||||||
CachedSettingValue<QVariantMap> m_storedCategories;
|
CachedSettingValue<QVariantMap> m_storedCategories;
|
||||||
CachedSettingValue<QStringList> m_storedTags;
|
CachedSettingValue<QStringList> m_storedTags;
|
||||||
CachedSettingValue<int> m_maxRatioAction;
|
CachedSettingValue<int> m_maxRatioAction;
|
||||||
|
@ -150,7 +150,7 @@ void AdvancedSettings::saveAdvancedSettings()
|
|||||||
session->setOutgoingPortsMin(outgoing_ports_min.value());
|
session->setOutgoingPortsMin(outgoing_ports_min.value());
|
||||||
session->setOutgoingPortsMax(outgoing_ports_max.value());
|
session->setOutgoingPortsMax(outgoing_ports_max.value());
|
||||||
// uTP-TCP mixed mode
|
// uTP-TCP mixed mode
|
||||||
session->setUtpMixedMode(comboUtpMixedMode.currentIndex());
|
session->setUtpMixedMode(static_cast<BitTorrent::MixedModeAlgorithm>(comboUtpMixedMode.currentIndex()));
|
||||||
// multiple connections per IP
|
// multiple connections per IP
|
||||||
session->setMultiConnectionsPerIpEnabled(cbMultiConnectionsPerIp.isChecked());
|
session->setMultiConnectionsPerIpEnabled(cbMultiConnectionsPerIp.isChecked());
|
||||||
// Recheck torrents on completion
|
// Recheck torrents on completion
|
||||||
@ -200,9 +200,9 @@ void AdvancedSettings::saveAdvancedSettings()
|
|||||||
session->setTrackerEnabled(cb_tracker_status.isChecked());
|
session->setTrackerEnabled(cb_tracker_status.isChecked());
|
||||||
pref->setTrackerPort(spin_tracker_port.value());
|
pref->setTrackerPort(spin_tracker_port.value());
|
||||||
// Choking algorithm
|
// Choking algorithm
|
||||||
session->setChokingAlgorithm(comboChokingAlgorithm.currentIndex());
|
session->setChokingAlgorithm(static_cast<BitTorrent::ChokingAlgorithm>(comboChokingAlgorithm.currentIndex()));
|
||||||
// Seed choking algorithm
|
// Seed choking algorithm
|
||||||
session->setSeedChokingAlgorithm(comboSeedChokingAlgorithm.currentIndex());
|
session->setSeedChokingAlgorithm(static_cast<BitTorrent::SeedChokingAlgorithm>(comboSeedChokingAlgorithm.currentIndex()));
|
||||||
|
|
||||||
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
||||||
pref->setUpdateCheckEnabled(cb_update_check.isChecked());
|
pref->setUpdateCheckEnabled(cb_update_check.isChecked());
|
||||||
@ -344,7 +344,7 @@ void AdvancedSettings::loadAdvancedSettings()
|
|||||||
addRow(OUTGOING_PORT_MAX, tr("Outgoing ports (Max) [0: Disabled]"), &outgoing_ports_max);
|
addRow(OUTGOING_PORT_MAX, tr("Outgoing ports (Max) [0: Disabled]"), &outgoing_ports_max);
|
||||||
// uTP-TCP mixed mode
|
// uTP-TCP mixed mode
|
||||||
comboUtpMixedMode.addItems({"Prefer TCP", "Peer proportional (throttles TCP)"});
|
comboUtpMixedMode.addItems({"Prefer TCP", "Peer proportional (throttles TCP)"});
|
||||||
comboUtpMixedMode.setCurrentIndex(session->utpMixedMode());
|
comboUtpMixedMode.setCurrentIndex(static_cast<int>(session->utpMixedMode()));
|
||||||
addRow(UTP_MIX_MODE, tr("uTP-TCP mixed mode algorithm"), &comboUtpMixedMode);
|
addRow(UTP_MIX_MODE, tr("uTP-TCP mixed mode algorithm"), &comboUtpMixedMode);
|
||||||
// multiple connections per IP
|
// multiple connections per IP
|
||||||
cbMultiConnectionsPerIp.setChecked(session->multiConnectionsPerIpEnabled());
|
cbMultiConnectionsPerIp.setChecked(session->multiConnectionsPerIpEnabled());
|
||||||
@ -429,11 +429,11 @@ void AdvancedSettings::loadAdvancedSettings()
|
|||||||
addRow(TRACKER_PORT, tr("Embedded tracker port"), &spin_tracker_port);
|
addRow(TRACKER_PORT, tr("Embedded tracker port"), &spin_tracker_port);
|
||||||
// Choking algorithm
|
// Choking algorithm
|
||||||
comboChokingAlgorithm.addItems({"Fixed slots", "Upload rate based"});
|
comboChokingAlgorithm.addItems({"Fixed slots", "Upload rate based"});
|
||||||
comboChokingAlgorithm.setCurrentIndex(session->chokingAlgorithm());
|
comboChokingAlgorithm.setCurrentIndex(static_cast<int>(session->chokingAlgorithm()));
|
||||||
addRow(CHOKING_ALGORITHM, tr("Upload slots behavior"), &comboChokingAlgorithm);
|
addRow(CHOKING_ALGORITHM, tr("Upload slots behavior"), &comboChokingAlgorithm);
|
||||||
// Seed choking algorithm
|
// Seed choking algorithm
|
||||||
comboSeedChokingAlgorithm.addItems({"Round-robin", "Fastest upload", "Anti-leech"});
|
comboSeedChokingAlgorithm.addItems({"Round-robin", "Fastest upload", "Anti-leech"});
|
||||||
comboSeedChokingAlgorithm.setCurrentIndex(session->seedChokingAlgorithm());
|
comboSeedChokingAlgorithm.setCurrentIndex(static_cast<int>(session->seedChokingAlgorithm()));
|
||||||
addRow(SEED_CHOKING_ALGORITHM, tr("Upload choking algorithm"), &comboSeedChokingAlgorithm);
|
addRow(SEED_CHOKING_ALGORITHM, tr("Upload choking algorithm"), &comboSeedChokingAlgorithm);
|
||||||
|
|
||||||
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
||||||
|
Loading…
Reference in New Issue
Block a user