Another place where My Documents was used on windows

This commit is contained in:
Kovid Goyal 2018-08-22 09:39:19 +05:30
parent c8d6a703c7
commit b20be85375
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -146,14 +146,9 @@ def get_library_path(gui_runner):
library_path = prefs['library_path']
if library_path is None: # Need to migrate to new database layout
base = os.path.expanduser('~')
if iswindows:
try:
base = winutil.special_folder_path(winutil.CSIDL_PERSONAL)
except ValueError:
base = None
if not base or not os.path.exists(base):
from PyQt5.Qt import QDir
base = unicode(QDir.homePath()).replace('/', os.sep)
if not base or not os.path.exists(base):
from PyQt5.Qt import QDir
base = unicode(QDir.homePath()).replace('/', os.sep)
candidate = gui_runner.choose_dir(base)
if not candidate:
candidate = os.path.join(base, 'Calibre Library')