mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Port QUrl::encodedPath that no longer exists in PyQt5
This commit is contained in:
parent
7ba42499b8
commit
8487dc0aae
@ -131,7 +131,9 @@ def data_as_string(f, md):
|
||||
return raw
|
||||
|
||||
def path_from_qurl(qurl):
|
||||
raw = bytes(bytearray(qurl.encodedPath()))
|
||||
raw = bytes(qurl.toEncoded(
|
||||
QUrl.PreferLocalFile | QUrl.RemoveScheme | QUrl.RemovePassword | QUrl.RemoveUserInfo |
|
||||
QUrl.RemovePort | QUrl.RemoveAuthority | QUrl.RemoveQuery | QUrl.RemoveFragment))
|
||||
return urllib.unquote(raw).decode('utf-8')
|
||||
|
||||
def dnd_has_extension(md, extensions):
|
||||
|
Loading…
x
Reference in New Issue
Block a user