Correctly detect libtorrent version.

This commit is contained in:
sledgehammer999
2014-01-03 02:05:07 +02:00
parent f93374a946
commit 9f71dd2c61
21 changed files with 114 additions and 115 deletions

View File

@@ -88,7 +88,7 @@ QString prefjson::getPreferences()
data.add("max_connec", pref.getMaxConnecs());
data.add("max_connec_per_torrent", pref.getMaxConnecsPerTorrent());
data.add("max_uploads_per_torrent", pref.getMaxUploadsPerTorrent());
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
data.add("enable_utp", pref.isuTPEnabled());
data.add("limit_utp_rate", pref.isuTPRateLimited());
#endif
@@ -110,7 +110,7 @@ QString prefjson::getPreferences()
data.add("pex", pref.isPeXEnabled());
data.add("lsd", pref.isLSDEnabled());
data.add("encryption", pref.getEncryptionSetting());
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
data.add("anonymous_mode", pref.isAnonymousModeEnabled());
#endif
// Proxy
@@ -246,7 +246,7 @@ void prefjson::setPreferences(const QString& json)
pref.setMaxConnecsPerTorrent(m["max_connec_per_torrent"].toInt());
if (m.contains("max_uploads_per_torrent"))
pref.setMaxUploadsPerTorrent(m["max_uploads_per_torrent"].toInt());
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
if (m.contains("enable_utp"))
pref.setuTPEnabled(m["enable_utp"].toBool());
if (m.contains("limit_utp_rate"))
@@ -284,7 +284,7 @@ void prefjson::setPreferences(const QString& json)
pref.setLSDEnabled(m["lsd"].toBool());
if (m.contains("encryption"))
pref.setEncryptionSetting(m["encryption"].toInt());
#if LIBTORRENT_VERSION_NUM >= 001600
#if LIBTORRENT_VERSION_NUM >= 1600
if (m.contains("anonymous_mode"))
pref.enableAnonymousMode(m["anonymous_mode"].toBool());
#endif