Philipp Hörist pushed to branch master at gajim / gajim
Commits: bd074785 by Emmanuel Gil Peyrot at 2016-12-24T04:58:30+01:00 Use GLib to retrieve the pictures directory.
Also remove an unused function.
- - - - - 8212bc25 by Philipp Hörist at 2016-12-24T08:50:35+01:00 Merge branch 'use-glib-directories' into 'master'
Use GLib to retrieve the pictures directory.
See merge request !12 - - - - -
2 changed files:
- src/common/helpers.py - src/dialogs.py
Changes:
===================================== src/common/helpers.py ===================================== --- a/src/common/helpers.py +++ b/src/common/helpers.py @@ -497,19 +497,6 @@ r'Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders') win32api.RegCloseKey(rkey) return val
-def get_my_pictures_path(): - """ - Windows-only atm - """ - return get_windows_reg_env('My Pictures') - -def get_desktop_path(): - if os.name == 'nt': - path = get_windows_reg_env('Desktop') - else: - path = os.path.join(os.path.expanduser('~'), 'Desktop') - return path - def get_documents_path(): if os.name == 'nt': path = get_windows_reg_env('Personal')
===================================== src/dialogs.py ===================================== --- a/src/dialogs.py +++ b/src/dialogs.py @@ -4960,13 +4960,7 @@ class ImageChooserDialog(FileChooserDialog): else: callback(widget, path_to_file)
- try: - if os.name == 'nt': - path = helpers.get_my_pictures_path() - else: - path = os.environ['HOME'] - except Exception: - path = '' + path = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES) FileChooserDialog.__init__(self, title_text = _('Choose Image'), action = Gtk.FileChooserAction.OPEN,
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/b43811df88092d918c0000347dac43cd94...