if win32 document dir invalid, use home dir instead

This commit is contained in:
Damien Elmes 2009-08-17 04:58:33 +09:00
parent 863dcfe389
commit ef30c88ad8

View file

@ -2768,6 +2768,8 @@ Consider backing up your media directory first."""))
s = QSettings(QSettings.UserScope, "Microsoft", "Windows")
s.beginGroup("CurrentVersion/Explorer/Shell Folders")
self.documentDir = unicode(s.value("Personal").toString())
if not os.path.exists(self.documentDir):
self.documentDir = os.path.expanduser("~/.anki")
elif sys.platform.startswith("darwin"):
self.documentDir = os.path.expanduser("~/Documents")
else: