summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2012-11-26 21:59:48 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2012-11-26 22:03:54 +0000
commite7a2a8dceedc693a3c069af35405603c879771f3 (patch)
tree191b4af92b4a6418057c90a4e9d6e9b6e14822ad
parent67450f43b300c53e3dec9b7b4f7b6d9638f1b117 (diff)
downloaddeluge-e7a2a8dce.zip
deluge-e7a2a8dce.tar.gz
deluge-e7a2a8dce.tar.bz2
Fix #2109 : Proxy settings not being cleared by setting None
-rw-r--r--deluge/core/preferencesmanager.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py
index 2a5cb1b..7a3cc2c 100644
--- a/deluge/core/preferencesmanager.py
+++ b/deluge/core/preferencesmanager.py
@@ -471,15 +471,14 @@ class PreferencesManager(component.Component):
def _on_set_proxies(self, key, value):
for k, v in value.items():
- if v["type"]:
- proxy_settings = lt.proxy_settings()
- proxy_settings.type = lt.proxy_type(v["type"])
- proxy_settings.username = str(v["username"])
- proxy_settings.password = str(v["password"])
- proxy_settings.hostname = str(v["hostname"])
- proxy_settings.port = v["port"]
- log.debug("setting %s proxy settings", k)
- getattr(self.session, "set_%s_proxy" % k)(proxy_settings)
+ proxy_settings = lt.proxy_settings()
+ proxy_settings.type = lt.proxy_type(v["type"])
+ proxy_settings.username = str(v["username"])
+ proxy_settings.password = str(v["password"])
+ proxy_settings.hostname = str(v["hostname"])
+ proxy_settings.port = v["port"]
+ log.debug("setting %s proxy settings", k)
+ getattr(self.session, "set_%s_proxy" % k)(proxy_settings)
def _on_rate_limit_ip_overhead(self, key, value):
log.debug("%s: %s", key, value)