summaryrefslogtreecommitdiff
path: root/src/tabs/rostertab.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-03-24 23:25:06 +0100
committermathieui <mathieui@mathieui.net>2014-03-24 23:25:06 +0100
commit8d4202501d68e165ef85f720e72cb83ce384eab8 (patch)
tree7145f62740f7e3176bd845a103e012d4effe4cc7 /src/tabs/rostertab.py
parent6b1e3dd4ac03b14a4af23cf3e0060f4c3d1de328 (diff)
downloadpoezio-8d4202501d68e165ef85f720e72cb83ce384eab8.tar.gz
poezio-8d4202501d68e165ef85f720e72cb83ce384eab8.tar.bz2
poezio-8d4202501d68e165ef85f720e72cb83ce384eab8.tar.xz
poezio-8d4202501d68e165ef85f720e72cb83ce384eab8.zip
Use RawConfigParser.get{int,bool,float} whenever possible
config.get('option', 'value').lower() == 'value' is just ugly and stupid, especially for bool. One if in basetabs:556 was also missing a comparison, leading to True whenever the option was set.
Diffstat (limited to 'src/tabs/rostertab.py')
-rw-r--r--src/tabs/rostertab.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/tabs/rostertab.py b/src/tabs/rostertab.py
index 22cad8b9..199be8f7 100644
--- a/src/tabs/rostertab.py
+++ b/src/tabs/rostertab.py
@@ -728,10 +728,8 @@ class RosterInfoTab(Tab):
Show or hide offline contacts
"""
option = 'roster_show_offline'
- if config.get(option, 'false') == 'false':
- success = config.silent_set(option, 'true')
- else:
- success = config.silent_set(option, 'false')
+ value = config.get(option, False)
+ success = config.silent_set(option, not value)
roster.modified()
if not success:
self.core.information(_('Unable to write in the config file'), 'Error')