mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
support unc pathnames again
Turns out that WebKit does support UNC pathnames in the base tag, but it is picky about the leading number of slashes.
This commit is contained in:
parent
273cb74e3d
commit
0afce5f19a
2 changed files with 2 additions and 11 deletions
|
@ -61,7 +61,6 @@ class ProfileManager(object):
|
|||
self.base = os.path.abspath(base)
|
||||
else:
|
||||
self.base = self._defaultBase()
|
||||
self.ensureLocalFS()
|
||||
self.ensureBaseExists()
|
||||
# load metadata
|
||||
self.firstRun = self._loadMeta()
|
||||
|
@ -75,15 +74,6 @@ class ProfileManager(object):
|
|||
# Base creation
|
||||
######################################################################
|
||||
|
||||
def ensureLocalFS(self):
|
||||
if self.base.startswith("\\\\"):
|
||||
QMessageBox.critical(
|
||||
None, "Error", """\
|
||||
To use Anki on a network share, the share must be mapped to a local drive \
|
||||
letter. Please see the 'File Locations' section of the manual for more \
|
||||
information.""")
|
||||
raise Exception("unc")
|
||||
|
||||
def ensureBaseExists(self):
|
||||
try:
|
||||
self._ensureExists(self.base)
|
||||
|
|
|
@ -330,10 +330,11 @@ def applyStyles(widget):
|
|||
def getBase(col):
|
||||
base = None
|
||||
mdir = col.media.dir()
|
||||
if isWin:
|
||||
if isWin and not mdir.startswith("\\\\"):
|
||||
prefix = u"file:///"
|
||||
else:
|
||||
prefix = u"file://"
|
||||
mdir = mdir.replace("\\", "/")
|
||||
base = prefix + unicode(
|
||||
urllib.quote(mdir.encode("utf-8")),
|
||||
"utf-8") + "/"
|
||||
|
|
Loading…
Reference in a new issue