Disable percent-decoding for QtWebEngine with Qt >= 5.8.1

This commit is contained in:
Florian Bruhin 2017-02-05 12:33:40 +01:00
parent b3ffd9a63d
commit b40a1bfb83

View File

@ -137,10 +137,12 @@ def _get_suggested_filename(path):
"""
filename = os.path.basename(path)
filename = re.sub(r'\([0-9]+\)$', '', filename)
# https://bugreports.qt.io/browse/QTBUG-58155
filename = urllib.parse.unquote(filename)
# Doing basename a *second* time because there could be a %2F in there...
filename = os.path.basename(filename)
if not qtutils.version_check('5.8.1'):
# https://bugreports.qt.io/browse/QTBUG-58155
filename = urllib.parse.unquote(filename)
# Doing basename a *second* time because there could be a %2F in
# there...
filename = os.path.basename(filename)
return filename