Fix compilation with libtorrent 1.x.x.

This commit is contained in:
sledgehammer999 2013-05-07 22:57:18 +03:00
parent 4f667c6e7d
commit 94b58ca229
19 changed files with 99 additions and 99 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_MINOR >= 16
#if LIBTORRENT_VERSION_MINOR >= 16 || LIBTORRENT_VERSION_MAJOR > 0
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_MINOR >= 16
#if LIBTORRENT_VERSION_MINOR >= 16 || LIBTORRENT_VERSION_MAJOR > 0
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_MINOR >= 16
#if LIBTORRENT_VERSION_MINOR >= 16 || LIBTORRENT_VERSION_MAJOR > 0
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_MINOR >= 16
#if LIBTORRENT_VERSION_MINOR >= 16 || LIBTORRENT_VERSION_MAJOR > 0
if (m.contains("anonymous_mode"))
pref.enableAnonymousMode(m["anonymous_mode"].toBool());
#endif