diff --git a/gajim/advanced_configuration_window.py b/gajim/advanced_configuration_window.py index a3e06b7af..fce0119d1 100644 --- 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 \ diff --git a/gajim/common/config.py b/gajim/common/config.py index 0bf18292a..966ecbe8d 100644 --- 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: + if subname not in dict_: return None - if key not in dict_: - return None - obj = dict_[key] - if not subname: - return None - if subname not in obj: - 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):