Skip to content

Commit

Permalink
Port QUrl::encodedPath that no longer exists in PyQt5
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Jul 9, 2014
1 parent 70ca441 commit f45e86c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/calibre/gui2/dnd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit f45e86c

Please sign in to comment.