mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
split dropbox folder calculation into seperate defn so plugins can change it
This commit is contained in:
parent
33372980cc
commit
bff095925d
1 changed files with 11 additions and 7 deletions
|
@ -2875,13 +2875,7 @@ This deck already exists on your computer. Overwrite the local copy?"""),
|
|||
if not prefix:
|
||||
next = ""
|
||||
elif prefix == "dropbox":
|
||||
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")
|
||||
p = self.dropboxFolder()
|
||||
next = os.path.join(p, "Public", "Anki")
|
||||
else:
|
||||
next = prefix
|
||||
|
@ -2925,6 +2919,16 @@ This deck already exists on your computer. Overwrite the local copy?"""),
|
|||
# everything copied, we can remove old folder
|
||||
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")
|
||||
return p
|
||||
|
||||
def setupDropbox(self, deck):
|
||||
if not self.config['dropboxPublicFolder']:
|
||||
# put a file in the folder
|
||||
|
|
Loading…
Reference in a new issue