detect dropbox location

This commit is contained in:
Damien Elmes 2011-01-13 18:32:03 +09:00
parent 462cfa5b83
commit 7a7c1d3b0d

View file

@ -2978,13 +2978,17 @@ to work with this version of Anki."""))
shutil.rmtree(from_, ignore_errors=True)
def dropboxFolder(self):
if sys.platform.startswith("win32"):
s = QSettings(QSettings.UserScope, "Microsoft", "Windows")
s.beginGroup("CurrentVersion/Explorer/Shell Folders")
p = os.path.join(unicode(s.value("Personal").toString()),
"My Dropbox")
else:
p = os.path.expanduser("~/Dropbox")
try:
import ankiqt.ui.dropbox as db
p = db.getPath()
except:
if sys.platform.startswith("win32"):
s = QSettings(QSettings.UserScope, "Microsoft", "Windows")
s.beginGroup("CurrentVersion/Explorer/Shell Folders")
p = os.path.join(unicode(s.value("Personal").toString()),
"My Dropbox")
else:
p = os.path.expanduser("~/Dropbox")
return p
def setupDropbox(self, deck):