Philipp Hörist pushed to branch master at gajim / gajim

Commits:

1 changed file:

Changes:

  • gajim/common/configpaths.py
    ... ... @@ -30,6 +30,8 @@ import sys
    30 30
     import tempfile
    
    31 31
     from pathlib import Path
    
    32 32
     
    
    33
    +from gi.repository import GLib
    
    34
    +
    
    33 35
     import gajim
    
    34 36
     from gajim.common.i18n import _
    
    35 37
     from gajim.common.const import PathType, PathLocation
    
    ... ... @@ -114,19 +116,10 @@ class ConfigPaths:
    114 116
                     # win9x, in cwd
    
    115 117
                     self.config_root = self.cache_root = self.data_root = '.'
    
    116 118
             else:
    
    117
    -            expand = os.path.expanduser
    
    118
    -            base = os.getenv('XDG_CONFIG_HOME')
    
    119
    -            if base is None or base[0] != '/':
    
    120
    -                base = expand('~/.config')
    
    121
    -            self.config_root = os.path.join(base, 'gajim')
    
    122
    -            base = os.getenv('XDG_CACHE_HOME')
    
    123
    -            if base is None or base[0] != '/':
    
    124
    -                base = expand('~/.cache')
    
    125
    -            self.cache_root = os.path.join(base, 'gajim')
    
    126
    -            base = os.getenv('XDG_DATA_HOME')
    
    127
    -            if base is None or base[0] != '/':
    
    128
    -                base = expand('~/.local/share')
    
    129
    -            self.data_root = os.path.join(base, 'gajim')
    
    119
    +            self.config_root = os.path.join(GLib.get_user_config_dir(),
    
    120
    +                                            'gajim')
    
    121
    +            self.cache_root = os.path.join(GLib.get_user_cache_dir(), 'gajim')
    
    122
    +            self.data_root = os.path.join(GLib.get_user_data_dir(), 'gajim')
    
    130 123
     
    
    131 124
             import pkg_resources
    
    132 125
             basedir = pkg_resources.resource_filename("gajim", ".")