Commit bd074785 authored by Emmanuel Gil Peyrot's avatar Emmanuel Gil Peyrot

Use GLib to retrieve the pictures directory.

Also remove an unused function.
parent f15497b0
......@@ -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')
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment