Added uTP support

This commit is contained in:
Christophe Dumez
2011-04-17 14:42:38 +00:00
parent ea433c0619
commit 641b38690c
10 changed files with 216 additions and 57 deletions

View File

@@ -62,7 +62,10 @@ namespace TrayIcon {
enum Style { NORMAL = 0, MONO_DARK, MONO_LIGHT };
}
namespace DNS {
enum Service { DYNDNS, NOIP };
enum Service { DYNDNS, NOIP };
}
namespace BT {
enum Protocol { TCP_uTP, TCP, uTP };
}
class Preferences : public QIniSettings {
@@ -537,6 +540,22 @@ public:
setValue(QString::fromUtf8("Preferences/Bittorrent/MaxUploadsPerTorrent"), val);
}
BT::Protocol getBTProtocol() const {
return (BT::Protocol)value(QString::fromUtf8("Preferences/Bittorrent/Protocol"), BT::TCP_uTP).toInt();
}
void setBTProtocol(int protocol) {
setValue("Preferences/Bittorrent/Protocol", protocol);
}
bool isuTPRateLimited() const {
return value(QString::fromUtf8("Preferences/Bittorrent/uTP_rate_limiting"), false).toBool();
}
void setuTPRateLimited(bool enabled) {
setValue("Preferences/Bittorrent/uTP_rate_limiting", enabled);
}
bool isDHTEnabled() const {
return value(QString::fromUtf8("Preferences/Bittorrent/DHT"), true).toBool();
}