mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
detect dropbox location
This commit is contained in:
parent
462cfa5b83
commit
7a7c1d3b0d
1 changed files with 11 additions and 7 deletions
|
@ -2978,13 +2978,17 @@ to work with this version of Anki."""))
|
||||||
shutil.rmtree(from_, ignore_errors=True)
|
shutil.rmtree(from_, ignore_errors=True)
|
||||||
|
|
||||||
def dropboxFolder(self):
|
def dropboxFolder(self):
|
||||||
if sys.platform.startswith("win32"):
|
try:
|
||||||
s = QSettings(QSettings.UserScope, "Microsoft", "Windows")
|
import ankiqt.ui.dropbox as db
|
||||||
s.beginGroup("CurrentVersion/Explorer/Shell Folders")
|
p = db.getPath()
|
||||||
p = os.path.join(unicode(s.value("Personal").toString()),
|
except:
|
||||||
"My Dropbox")
|
if sys.platform.startswith("win32"):
|
||||||
else:
|
s = QSettings(QSettings.UserScope, "Microsoft", "Windows")
|
||||||
p = os.path.expanduser("~/Dropbox")
|
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
|
return p
|
||||||
|
|
||||||
def setupDropbox(self, deck):
|
def setupDropbox(self, deck):
|
||||||
|
|
Loading…
Reference in a new issue