Philipp Hörist pushed to branch master at gajim / gajim
Commits:
e6840ab8 by SaltyBones at 2017-07-11T20:35:47+02:00
fixed lookup of description for keyed options
- - - - -
84f48a40 by Philipp Hörist at 2017-07-11T20:45:53+02:00
Merge branch 'master' into 'master'
fixed lookup of description for keyed options
See merge request !105
- - - - -
2 changed files:
- gajim/advanced_configuration_window.py
- gajim/common/config.py
Changes:
=====================================
gajim/advanced_configuration_window.py
=====================================
--- a/gajim/advanced_configuration_window.py
+++ b/gajim/advanced_configuration_window.py
@@ -166,8 +166,7 @@ class AdvancedConfigurationWindow(object):
# Get text from first column in this row
desc = None
if len(opt_path) == 3:
- desc = gajim.config.get_desc_per(opt_path[2], opt_path[1],
- opt_path[0])
+ desc = gajim.config.get_desc_per(opt_path[2], opt_path[0])
elif len(opt_path) == 1:
desc = gajim.config.get_desc(opt_path[0])
if desc:
@@ -322,8 +321,7 @@ class AdvancedConfigurationWindow(object):
if model[it][Column.TYPE] != '':
opt_path = self.get_option_path(model, it)
if len(opt_path) == 3:
- desc = gajim.config.get_desc_per(opt_path[2], opt_path[1],
- opt_path[0])
+ desc = gajim.config.get_desc_per(opt_path[2], opt_path[0])
elif len(opt_path) == 1:
desc = gajim.config.get_desc(opt_path[0])
if search_string in model[it][Column.PREFERENCE_NAME] or (desc
and \
=====================================
gajim/common/config.py
=====================================
--- a/gajim/common/config.py
+++ b/gajim/common/config.py
@@ -746,21 +746,15 @@ class Config:
return None
return dict_[subname][Option.TYPE][0]
- def get_desc_per(self, optname, key=None, subname=None):
+ def get_desc_per(self, optname, subname=None):
if optname not in self.__options_per_key:
return None
dict_ = self.__options_per_key[optname][0]
- if not key:
- return None
- if key not in dict_:
- return None
- obj = dict_[key]
- if not subname:
- return None
- if subname not in obj:
+ if subname not in dict_:
return None
- if len(obj[subname]) > Option.DESC:
- return obj[subname][Option.DESC]
+ obj = dict_[subname]
+ if len(obj) > Option.DESC:
+ return obj[Option.DESC]
return None
def get_restart_per(self, optname, key=None, subname=None):
View it on GitLab:
https://dev.gajim.org/gajim/gajim/compare/cc682d243f0be13e07a9a29dc91a177940f9ac7f...84f48a400c5bb4a5ca17be0c8b452d934e043613
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits